Colin Copeland avatar Colin Copeland committed 71b3aed

add service templates

Comments (0)

Files changed (3)

services/templates/gunicorn.conf

+bind = "127.0.0.1:%(server_port)s"
+workers = 3
+worker_class = 'gevent'

services/templates/nginx.conf

+upstream django_server {
+    server 127.0.0.1:%(server_port)s fail_timeout=0;
+}
+
+server {
+    listen 80;
+    client_max_body_size 4G;
+
+    keepalive_timeout 5;
+
+    access_log %(log_dir)s/access.log;
+    error_log %(log_dir)s/error.log;
+
+    location /media {
+        root %(code_root)s;
+    }
+
+    location /static {
+        root %(code_root)s;
+    }
+
+    location / {
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header Host $http_host;
+        proxy_redirect off;
+        proxy_buffering on;
+
+        if (!-f $request_filename) {
+            proxy_pass http://django_server;
+            break;
+        }
+
+    }
+}

services/templates/supervisor.conf

+[program:%(environment)s-server]
+process_name=%%(program_name)s
+command=%(virtualenv_root)s/bin/gunicorn_django -c %(services)s/gunicorn/%(environment)s.py local_settings.py
+directory=%(project_root)s
+user=%(user)s
+autostart=true
+autorestart=true
+stdout_logfile=%(log_dir)s/gunicorn.log
+redirect_stderr=true
+stderr_logfile=%(log_dir)s/gunicorn-error.log
+
+
+[program:%(environment)s-celeryd]
+command=%(virtualenv_root)s/bin/python %(project_root)s/manage.py celeryd --loglevel=INFO
+directory=%(project_root)s
+user=%(user)s
+numprocs=1
+autostart=true
+autorestart=true
+stdout_logfile=%(log_dir)s/celeryd.log
+redirect_stderr=true
+stderr_logfile=%(log_dir)s/celeryd-error.log
+startsecs=10
+; Need to wait for currently executing tasks to finish at shutdown.
+; Increase this if you have very long running tasks.
+stopwaitsecs = 600
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=998
+
+
+[program:%(environment)s-celerybeat]
+command=%(virtualenv_root)s/bin/python %(project_root)s/manage.py celerybeat --schedule=%(services)s/supervisor/%(environment)s-celerybeat-schedule --loglevel=INFO
+directory=%(project_root)s
+user=%(user)s
+numprocs=1
+autostart=true
+autorestart=true
+stdout_logfile=%(log_dir)s/celerybeat.log
+redirect_stderr=true
+stderr_logfile=%(log_dir)s/celerybeat-error.log
+startsecs=10
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=999
+
+
+[group:%(environment)s]
+programs=%(environment)s-celeryd,%(environment)s-celerybeat,%(environment)s-server
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.