2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-23 12:43:28 +00:00

Dockerfile updates

- Pipe supervisor logs to stdout (so they are passed to the docker instance)
- Fix supervisor service
- Expose home dir and port as env vars
This commit is contained in:
Oliver Walters
2021-04-01 20:30:51 +11:00
parent d446f8ddd1
commit 839c29117d
2 changed files with 14 additions and 10 deletions

41
docker/supervisor.conf Normal file
View File

@@ -0,0 +1,41 @@
; # Supervisor Config File (for docker build)
;
; This config file is specific to the InvenTree docker build!
;
; There are two separate processes which must be managed:
;
; ## Web Server
; The InvenTree server must be launched and managed as a process
; The recommended way to handle the web server is to use gunicorn
;
; ## Background Tasks
; A background task manager processes long-running and periodic tasks
; InvenTree uses django-q for this purpose
[supervisord]
nodaemon=true
[program:inventree-server]
user=inventree
directory=/home/inventree/src/InvenTree
command=/home/inventree/env/bin/gunicorn -c gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:%(INVENTREE_PORT)s
startsecs=10
autostart=true
autorestart=true
startretries=3
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
[program:inventree-cluster]
user=inventree
directory=/home/inventree/src/InvenTree
command=/home/inventree/env/bin/python manage.py qcluster
startsecs=10
autostart=true
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0