Add entrypoint for running development worker

This commit is contained in:
Oliver Walters 2021-05-12 22:12:26 +10:00
parent 530f28ba95
commit 719b1775f2
3 changed files with 23 additions and 1 deletions

View File

@ -105,6 +105,8 @@ FROM base as dev
WORKDIR ${INVENTREE_SRC_DIR}
COPY start_dev_server.sh ${INVENTREE_HOME}/start_dev_server.sh
COPY start_dev_worker.sh ${INVENTREE_HOME}/start_dev_worker.sh
RUN chmod 755 ${INVENTREE_HOME}/start_dev_server.sh
RUN chmod 755 ${INVENTREE_HOME}/start_dev_worker.sh
CMD ["bash", "/home/inventree/start_dev_server.sh"]

View File

@ -35,7 +35,8 @@ services:
build:
context: .
target: dev
entrypoint: invoke worker
entrypoint: /home/inventree/start_dev_worker.sh
depends_on:
- inventree-server
volumes:
# Ensure you specify the location of the 'src' directory at the end of this file

View File

@ -0,0 +1,19 @@
#!/bin/sh
echo "Starting InvenTree worker..."
cd $INVENTREE_SRC_DIR
# Activate virtual environment
source inventree-docker-dev/bin/activate
sleep 5
# Wait for the database to be ready
cd $INVENTREE_MNG_DIR
python manage.py wait_for_db
sleep 10
# Now we can launch the background worker process
python manage.py qcluster