[Docker] Fix broken production image (#6953)

* Check for presense of manage.py

* Fix directory copying
This commit is contained in:
Oliver 2024-04-04 23:55:55 +11:00 committed by GitHub
parent d08a6ad18e
commit 6730cdbccf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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