2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 03:56:43 +00:00

Dockerfile updates

This commit is contained in:
Oliver Walters 2021-04-07 22:27:55 +10:00
parent d91531720b
commit 4a3ca4638c
4 changed files with 7 additions and 4 deletions

View File

@ -27,5 +27,5 @@ class Command(BaseCommand):
# prints success messge in green # prints success messge in green
self.stdout.write(self.style.SUCCESS('InvenTree database connected')) self.stdout.write(self.style.SUCCESS('InvenTree database connected'))
except OperationalError: except OperationalError:
self.stdout.write("Database unavailable, waiting 5 seconds ...") self.stdout.write(self.style.ERROR("Database unavailable, waiting 5 seconds ..."))
time.sleep(5) time.sleep(5)

View File

@ -79,7 +79,7 @@ RUN apk add --no-cache supervisor
RUN mkdir ${INVENTREE_HOME}/media ${INVENTREE_HOME}/static ${INVENTREE_HOME}/backup RUN mkdir ${INVENTREE_HOME}/media ${INVENTREE_HOME}/static ${INVENTREE_HOME}/backup
# Copy supervisor file # Copy supervisor file
COPY docker/supervisor.conf /etc/supervisord.conf COPY docker/supervisord.conf ${INVENTREE_HOME}/supervisord.conf
# Copy gunicorn config file # Copy gunicorn config file
COPY docker/gunicorn.conf.py ${INVENTREE_HOME}/gunicorn.conf.py COPY docker/gunicorn.conf.py ${INVENTREE_HOME}/gunicorn.conf.py

View File

@ -15,6 +15,8 @@ fi
# Activate virtual environment # Activate virtual environment
source $INVENTREE_VENV/bin/activate source $INVENTREE_VENV/bin/activate
sleep 5
# Wait for the database to be ready # Wait for the database to be ready
cd $INVENTREE_MNG_DIR cd $INVENTREE_MNG_DIR
python manage.py wait_for_db python manage.py wait_for_db
@ -32,4 +34,4 @@ python manage.py collectstatic --noinput || exit 1
python manage.py clearsessions || exit 1 python manage.py clearsessions || exit 1
# Now we can launch the server and background worker # Now we can launch the server and background worker
/usr/bin/supervisord -c /etc/supervisord.conf /usr/bin/supervisord -c $INVENTREE_HOME/supervisord.conf

View File

@ -13,6 +13,7 @@
; InvenTree uses django-q for this purpose ; InvenTree uses django-q for this purpose
[supervisord] [supervisord]
user=inventree
nodaemon=true nodaemon=true
[program:inventree-server] [program:inventree-server]
@ -31,7 +32,7 @@ stderr_logfile_maxbytes=0
[program:inventree-cluster] [program:inventree-cluster]
user=inventree user=inventree
directory=%(ENV_INVENTREE_SRC_DIR)s/InvenTree directory=%(ENV_INVENTREE_SRC_DIR)s/InvenTree
command=%(ENV_INVENTREE_VENV)s/bin/python manage.py qcluster command=%(ENV_INVENTREE_VENV)s/bin/python DJANGO_SETTINGS_FILE=InvenTree.settings manage.py qcluster
startsecs=10 startsecs=10
autostart=true autostart=true
autorestart=true autorestart=true