From 56c3697e340e6b6ea32ec8be270f4511a4bdfb66 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Jul 2021 12:57:37 +1000 Subject: [PATCH 1/3] docker: Use a specific version of alpine --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e27bd5591a..7e264d2ce8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:alpine as base +FROM alpine:3.13 as base # GitHub source ARG repository="https://github.com/inventree/InvenTree.git" From 9cdc5a1fa1fe7b8c0162e722557f3c32783c334b Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Jul 2021 12:59:54 +1000 Subject: [PATCH 2/3] Explicitly install python3-pip --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7e264d2ce8..72e6acc8ca 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -57,7 +57,7 @@ RUN apk add --no-cache cairo cairo-dev pango pango-dev RUN apk add --no-cache fontconfig ttf-droid ttf-liberation ttf-dejavu ttf-opensans ttf-ubuntu-font-family font-croscore font-noto # Python -RUN apk add --no-cache python3 python3-dev +RUN apk add --no-cache python3 python3-dev py3-pip # SQLite support RUN apk add --no-cache sqlite From fa1644ed2ce536d122f66151e3926f53e612566b Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Jul 2021 13:07:42 +1000 Subject: [PATCH 3/3] python -> python3 --- docker/start_dev_server.sh | 12 ++++++------ docker/start_dev_worker.sh | 4 ++-- docker/start_prod_server.sh | 14 +++++++------- docker/start_prod_worker.sh | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docker/start_dev_server.sh b/docker/start_dev_server.sh index ad12ec023a..fcd178915c 100644 --- a/docker/start_dev_server.sh +++ b/docker/start_dev_server.sh @@ -32,7 +32,7 @@ echo "Starting InvenTree server..." # Wait for the database to be ready cd ${INVENTREE_HOME}/InvenTree -python manage.py wait_for_db +python3 manage.py wait_for_db sleep 10 @@ -40,10 +40,10 @@ echo "Running InvenTree database migrations..." # We assume at this stage that the database is up and running # Ensure that the database schema are up to date -python manage.py check || exit 1 -python manage.py migrate --noinput || exit 1 -python manage.py migrate --run-syncdb || exit 1 -python manage.py clearsessions || exit 1 +python3 manage.py check || exit 1 +python3 manage.py migrate --noinput || exit 1 +python3 manage.py migrate --run-syncdb || exit 1 +python3 manage.py clearsessions || exit 1 # Launch a development server -python manage.py runserver ${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT} +python3 manage.py runserver ${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT} diff --git a/docker/start_dev_worker.sh b/docker/start_dev_worker.sh index bfadc1f49a..7ee59ff28f 100644 --- a/docker/start_dev_worker.sh +++ b/docker/start_dev_worker.sh @@ -11,9 +11,9 @@ sleep 5 # Wait for the database to be ready cd InvenTree -python manage.py wait_for_db +python3 manage.py wait_for_db sleep 10 # Now we can launch the background worker process -python manage.py qcluster +python3 manage.py qcluster diff --git a/docker/start_prod_server.sh b/docker/start_prod_server.sh index 9d86b331eb..1bba2c9ed3 100644 --- a/docker/start_prod_server.sh +++ b/docker/start_prod_server.sh @@ -23,7 +23,7 @@ echo "Starting InvenTree server..." # Wait for the database to be ready cd $INVENTREE_MNG_DIR -python manage.py wait_for_db +python3 manage.py wait_for_db sleep 10 @@ -31,12 +31,12 @@ echo "Running InvenTree database migrations and collecting static files..." # We assume at this stage that the database is up and running # Ensure that the database schema are up to date -python manage.py check || exit 1 -python manage.py migrate --noinput || exit 1 -python manage.py migrate --run-syncdb || exit 1 -python manage.py prerender || exit 1 -python manage.py collectstatic --noinput || exit 1 -python manage.py clearsessions || exit 1 +python3 manage.py check || exit 1 +python3 manage.py migrate --noinput || exit 1 +python3 manage.py migrate --run-syncdb || exit 1 +python3 manage.py prerender || exit 1 +python3 manage.py collectstatic --noinput || exit 1 +python3 manage.py clearsessions || exit 1 # Now we can launch the server gunicorn -c $INVENTREE_HOME/gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:$INVENTREE_WEB_PORT \ No newline at end of file diff --git a/docker/start_prod_worker.sh b/docker/start_prod_worker.sh index ba9eb14d65..4a13d71230 100644 --- a/docker/start_prod_worker.sh +++ b/docker/start_prod_worker.sh @@ -6,9 +6,9 @@ sleep 5 # Wait for the database to be ready cd $INVENTREE_MNG_DIR -python manage.py wait_for_db +python3 manage.py wait_for_db sleep 10 # Now we can launch the background worker process -python manage.py qcluster \ No newline at end of file +python3 manage.py qcluster \ No newline at end of file