Fix location of entrypoint scripts

This commit is contained in:
Oliver Walters 2021-04-10 22:35:10 +10:00
parent 5d9e273559
commit 8f626d305e
4 changed files with 19 additions and 9 deletions

View File

@ -82,14 +82,16 @@ RUN pip install --no-cache-dir -U -r ${INVENTREE_SRC_DIR}/requirements.txt
COPY gunicorn.conf.py ${INVENTREE_HOME}/gunicorn.conf.py COPY gunicorn.conf.py ${INVENTREE_HOME}/gunicorn.conf.py
# Copy startup scripts # Copy startup scripts
COPY start_server.sh ${INVENTREE_HOME}/start_server.sh COPY start_server.sh ${INVENTREE_SRC_DIR}/start_server.sh
COPY start_worker.sh ${INVENTREE_HOME}/start_worker.sh COPY start_worker.sh ${INVENTREE_SRC_DIR}/start_worker.sh
RUN chmod 755 ${INVENTREE_HOME}/start_server.sh RUN chmod 755 ${INVENTREE_SRC_DIR}/start_server.sh
RUN chmod 755 ${INVENTREE_HOME}/start_worker.sh RUN chmod 755 ${INVENTREE_SRC_DIR}/start_worker.sh
# exec commands should be executed from the "src" directory # exec commands should be executed from the "src" directory
WORKDIR ${INVENTREE_SRC_DIR} WORKDIR ${INVENTREE_SRC_DIR}
USER inventree
# Let us begin # Let us begin
CMD ["bash", "../start_server.sh"] CMD ["bash", "./start_server.sh"]

View File

@ -2,9 +2,9 @@ version: "3.8"
# Docker compose recipe for InvenTree # Docker compose recipe for InvenTree
# - Runs PostgreSQL as the database backend # - Runs PostgreSQL as the database backend
# - Serves web data using Gunicorn # - Runs Gunicorn as the web server
# - Runs the background worker process
# - Runs nginx as a reverse proxy # - Runs nginx as a reverse proxy
# - Runs the background worker process
services: services:
# Database service # Database service
@ -60,6 +60,7 @@ services:
depends_on: depends_on:
- inventree - inventree
ports: ports:
# Change "1337" to the port where you want InvenTree web server to be available
- 1337:80 - 1337:80
volumes: volumes:
- static:/home/inventree/static - static:/home/inventree/static

View File

@ -5,8 +5,7 @@ echo "Starting InvenTree worker..."
sleep 5 sleep 5
# Wait for the database to be ready # Wait for the database to be ready
cd src/InvenTree cd $INVENTREE_MNG_DIR
python manage.py wait_for_db python manage.py wait_for_db
sleep 10 sleep 10

View File

@ -117,6 +117,14 @@ def check(c):
manage(c, "check") manage(c, "check")
@task
def wait(c):
"""
Wait until the database connection is ready
"""
manage(c, "wait_for_db")
@task @task
def migrate(c): def migrate(c):
""" """