From 6730cdbccfeba192f6bf6028a7387424ef408355 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 4 Apr 2024 23:55:55 +1100 Subject: [PATCH] [Docker] Fix broken production image (#6953) * Check for presense of manage.py * Fix directory copying --- .github/workflows/docker.yaml | 1 + contrib/container/Dockerfile | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 44acb8756c..1fccc6bbf8 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -89,6 +89,7 @@ jobs: docker run --rm inventree-test invoke --list docker run --rm inventree-test gunicorn --version docker run --rm inventree-test pg_dump --version + docker run --rm inventree-test test -f /home/inventree/src/backend/InvenTree/manage.py - name: Build Docker Image # Build the development docker image (using docker-compose.yml) run: docker compose --project-directory . -f contrib/container/dev-docker-compose.yml build --no-cache diff --git a/contrib/container/Dockerfile b/contrib/container/Dockerfile index 67921c33de..38901aae1a 100644 --- a/contrib/container/Dockerfile +++ b/contrib/container/Dockerfile @@ -33,6 +33,8 @@ ENV INVENTREE_MEDIA_ROOT="${INVENTREE_DATA_DIR}/media" ENV INVENTREE_BACKUP_DIR="${INVENTREE_DATA_DIR}/backup" ENV INVENTREE_PLUGIN_DIR="${INVENTREE_DATA_DIR}/plugins" +ENV INVENTREE_BACKEND_DIR="${INVENTREE_HOME}/src/backend" + # InvenTree configuration files ENV INVENTREE_CONFIG_FILE="${INVENTREE_DATA_DIR}/config.yaml" ENV INVENTREE_SECRET_KEY_FILE="${INVENTREE_DATA_DIR}/secret_key.txt" @@ -122,10 +124,9 @@ ENV INVENTREE_COMMIT_DATE="${commit_date}" ENV PATH=/root/.local/bin:$PATH COPY --from=prebuild /root/.local /root/.local -ENV INVENTREE_BACKEND_DIR="${INVENTREE_HOME}" # Copy source code -COPY src/backend/InvenTree ./InvenTree +COPY src/backend/InvenTree ${INVENTREE_HOME}/src/backend/InvenTree COPY --from=frontend ${INVENTREE_HOME}/src/backend/InvenTree/web/static/web ./src/backend/InvenTree/web/static/web # Launch the production server @@ -133,8 +134,6 @@ CMD gunicorn -c ./gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:8000 --chdir ./Inve FROM inventree_base AS dev -ENV INVENTREE_BACKEND_DIR="${INVENTREE_HOME}/src/backend" - # Vite server (for local frontend development) EXPOSE 5173