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

View File

@ -16,6 +16,10 @@ ARG INVENTREE_DB_PASSWORD=""
ENV PYTHONUNBUFFERED 1
# InvenTree key settings
ENV INVENTREE_HOME="${INVENTREE_HOME}"
ENV INVENTREE_PORT="${INVENTREE_PORT}"
# InvenTree paths
ENV INVENTREE_SRC_DIR="${INVENTREE_HOME}/src"
ENV INVENTREE_STATIC_ROOT="${INVENTREE_HOME}/static"
@ -78,6 +82,6 @@ RUN apk add --no-cache supervisor
RUN mkdir /home/inventree/media /home/inventree/static /home/inventree/log /home/inventree/backup
# Copy supervisor file
COPY docker/inventree.conf /etc/supervisor/conf.d/inventree.conf
COPY docker/supervisor.conf /etc/supervisord.conf
CMD ["/usr/bin/supervisord"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

View File

@ -13,8 +13,6 @@
; InvenTree uses django-q for this purpose
[supervisord]
; Change this path if log files are stored elsewhere
logfile=/home/inventree/log/supervisor.log
nodaemon=true
[program:inventree-server]
@ -25,9 +23,10 @@ startsecs=10
autostart=true
autorestart=true
startretries=3
; Change these paths if log files are stored elsewhere
stderr_logfile=/home/inventree/log/server.err.log
stdout_logfile=/home/inventree/log/server.out.log
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
[program:inventree-cluster]
user=inventree
@ -36,6 +35,7 @@ command=/home/inventree/env/bin/python manage.py qcluster
startsecs=10
autostart=true
autorestart=true
; Change these paths if log files are stored elsewhere
stderr_logfile=/home/inventree/log/cluster.err.log
stdout_logfile=/home/inventree/log/cluster.out.log
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0