Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
add systemd services and nginx base config
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorina committed Mar 3, 2017
1 parent bdffd4d commit e172a8a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
37 changes: 37 additions & 0 deletions nginx-dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Add this to the main nginx.conf
#gzip on;
#gzip_disable "msie6";
#gzip_vary on;
#gzip_proxied any;
#gzip_comp_level 6;
#gzip_types text/plain application/javascript application/octet-stream text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
#gzip_min_length 256;


# this config should be in the sites-enabled, use /usr/local prefix if nginx is installed under that directory otherwise remove this prefix from the directories below
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
charset utf-8;
# root /var/www/html;
client_max_body_size 64M;
#index index.html index.htm index.nginx-debian.html;

location /static {
alias /usr/local/var/www/daemo/;
}

location / {
uwsgi_pass unix:/var/tmp/webserver.socket;
include /usr/local/etc/nginx/uwsgi_params;
# try_files $uri $uri/ =404;
}

location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://unix:/var/tmp/websockets.socket;
}
}
11 changes: 11 additions & 0 deletions systemd/celery.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Celery background tasks for Daemo
After=network.target

[Service]
User=celery
Group=celery
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/celery -A csp worker -l info -B'

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions systemd/uwsgi_web.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=uWSGI instance to serve Daemo API
After=syslog.target

[Service]
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/uwsgi --socket /var/tmp/webserver.socket --buffer-size=32768 --workers=5 --master --module csp.webserver --chmod-socket=666 --chown-socket=www-data:www-data'
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions systemd/uwsgi_ws.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=uWSGI instance to serve web sockets
After=syslog.target

[Service]
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/uwsgi --http-socket /var/tmp/websockets.socket --gevent=1000 --http-websockets --workers=2 --master --module csp.websockets --chmod-socket=666 --chown-socket=www-data:www-data'
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

0 comments on commit e172a8a

Please sign in to comment.