-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from nofusscomputing/development
- Loading branch information
Showing
15 changed files
with
263 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
mkdir -p /etc/supervisor/conf.d; | ||
|
||
if [ "$1" == "" ]; then | ||
|
||
|
||
echo "[Info] Setup SupervisorD" | ||
|
||
if [ ${IS_WORKER} == 'True' ] || [ ${IS_WORKER} == 'true' ]; then | ||
|
||
|
||
echo '[info] Creating worker service config'; | ||
|
||
cp /etc/supervisor/conf.source/worker.conf /etc/supervisor/conf.d/worker.conf; | ||
|
||
if [ -f '/etc/supervisor/conf.d/worker.conf' ]; then | ||
|
||
echo '[info] Worker service config Created'; | ||
|
||
else | ||
|
||
echo '[crit] Worker service config not created'; | ||
|
||
fi; | ||
|
||
|
||
else | ||
|
||
echo '[info] Creating gunicorn service config'; | ||
|
||
cp /etc/supervisor/conf.source/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf; | ||
|
||
if [ -f '/etc/supervisor/conf.d/gunicorn.conf' ]; then | ||
|
||
echo '[info] Gunicorn service config Created'; | ||
|
||
else | ||
|
||
echo '[crit] Gunicorn service config not created'; | ||
|
||
fi; | ||
|
||
|
||
echo '[info] Creating nginx service config'; | ||
|
||
cp /etc/supervisor/conf.source/nginx.conf /etc/supervisor/conf.d/nginx.conf; | ||
|
||
if [ -f '/etc/supervisor/conf.d/nginx.conf' ]; then | ||
|
||
echo '[info] NginX service config Created'; | ||
|
||
else | ||
|
||
echo '[crit] NginX service config not created'; | ||
|
||
fi; | ||
|
||
|
||
fi; | ||
|
||
|
||
echo "[Info] SupervisorD Setup successfully" | ||
|
||
|
||
/usr/local/bin/supervisord; | ||
|
||
|
||
else | ||
|
||
exec "$@" | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server { | ||
|
||
listen 8000; | ||
|
||
location = /favicon.ico { access_log off; log_not_found off; } | ||
|
||
location /static/ { | ||
|
||
alias /app/static/; | ||
|
||
} | ||
|
||
location / { | ||
|
||
include proxy_params; | ||
|
||
proxy_pass http://unix:/run/gunicorn.sock; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[program:gunicorn] | ||
priority=1 | ||
startsecs=0 | ||
stopwaitsecs=55 | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/%(program_name)s.log | ||
stderr_logfile=/var/log/%(program_name)s.log | ||
directory=/app | ||
command=gunicorn --access-logfile - --workers 10 --bind unix:/run/gunicorn.sock app.wsgi:application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[program:nginx] | ||
startsecs=0 | ||
stopwaitsecs=55 | ||
command=nginx -g "daemon off;" | ||
autorestart=true | ||
autostart=true | ||
stdout_logfile=/var/log/%(program_name)s.log | ||
stderr_logfile=/var/log/%(program_name)s.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[program:celery] | ||
priority=1 | ||
startsecs=0 | ||
stopwaitsecs=55 | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/%(program_name)s.log | ||
stderr_logfile=/var/log/%(program_name)s.log | ||
directory=/app | ||
command=celery -A app worker -l INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
[unix_http_server] | ||
file=/run/supervisor.sock ; (the path to the socket file) | ||
chmod=0700 ; sockef file mode (default 0700) | ||
|
||
;[inet_http_server] | ||
;port = :9001 | ||
; username = user | ||
; password = 123 | ||
|
||
[supervisord] | ||
logfile=/var/log/supervisord.log | ||
pidfile=/run/supervisord.pid | ||
childlogdir=/var/log | ||
nodaemon = true | ||
|
||
; the below section must remain in the config file for RPC | ||
; (supervisorctl/web interface) to work, additional interfaces may be | ||
; added by defining them in separate rpcinterface: sections | ||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
[supervisorctl] | ||
serverurl=unix:///run/supervisor.sock ; use a unix:// URL for a unix socket | ||
|
||
; The [include] section can just contain the "files" setting. This | ||
; setting can list multiple files (separated by whitespace or | ||
; newlines). It can also contain wildcards. The filenames are | ||
; interpreted as relative to this file. Included files *cannot* | ||
; include files themselves. | ||
|
||
[include] | ||
files = /etc/supervisor/conf.d/*.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters