Restructuring docker project
This commit is contained in:
26
config/nginx.conf
Executable file
26
config/nginx.conf
Executable file
@@ -0,0 +1,26 @@
|
||||
worker_processes 5; ## Default: 1
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
user nobody nogroup;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http{
|
||||
server {
|
||||
listen $NGINX_PORT;
|
||||
|
||||
location / {
|
||||
include proxy_params;
|
||||
proxy_pass http://unix:/tmp/react.sock;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
include uwsgi_params;
|
||||
uwsgi_pass unix:/tmp/uwsgi.sock;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
4
config/start_nginx.sh
Normal file
4
config/start_nginx.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#/bin/bash
|
||||
|
||||
envsubst '$NGINX_PORT' < /tmp/nginx.conf > /etc/nginx/nginx.conf
|
||||
/usr/sbin/nginx -g "daemon off;" || exit 1
|
||||
37
config/supervisord.conf
Executable file
37
config/supervisord.conf
Executable file
@@ -0,0 +1,37 @@
|
||||
[supervisord]
|
||||
logfile = /dev/null
|
||||
loglevel = info
|
||||
user = root
|
||||
pidfile = /var/run/supervisord.pid
|
||||
nodaemon = true
|
||||
|
||||
[program:backend]
|
||||
directory=/execute
|
||||
user = nobody
|
||||
command=python3 app.py
|
||||
startsecs=10
|
||||
stopsignal=QUIT
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
|
||||
[program:frontend]
|
||||
directory=/execute
|
||||
user = nobody
|
||||
command=serve -s frontend -l unix:/tmp/react.sock
|
||||
startsecs=10
|
||||
stopsignal=QUIT
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
|
||||
[program:nginx]
|
||||
command=bash /tmp/start_nginx.sh
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user = root
|
||||
startretries=5
|
||||
numprocs=1
|
||||
startsecs=0
|
||||
stderr_logfile=/var/log/supervisor/%(program_name)s_stderr.log
|
||||
stderr_logfile_maxbytes=10MB
|
||||
stdout_logfile=/var/log/supervisor/%(program_name)s_stdout.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
Reference in New Issue
Block a user