diff --git a/backend/Dockerfile b/backend/Dockerfile index d08bfcc..54b0822 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.6-alpine3.20 AS dev +FROM python:3.12.6-alpine3.20 ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV BASE_URL="" @@ -18,9 +18,6 @@ RUN apk update --no-cache \ ENTRYPOINT ["sh", "/entrypoint.sh"] -CMD python manage.py runserver 0.0.0.0:8000 - -FROM dev as prod #ARG is required for the settings.py. Otherwise the build will fail, because required env variables have not been set ARG BUILD=1 @@ -32,4 +29,4 @@ USER baseuser EXPOSE 8000 # Overwrites previous CMD from stage "dev" -#CMD gunicorn securecheckplus.wsgi:application --bind 0.0.0.0:8000 --workers=2 --threads=2 --log-level INFO +CMD ["gunicorn", "securecheckplus.wsgi:application", "--bind", "0.0.0.0:8000", "--workers=2", "--threads=2", "--log-level", "$LOG_LEVEL"] diff --git a/backend/env.template b/backend/env.template index fe9d460..745ffef 100644 --- a/backend/env.template +++ b/backend/env.template @@ -8,6 +8,9 @@ IS_DEV=True # This is the URL that the application can be reached at FULLY_QUALIFIED_DOMAIN_NAME=http://localhost:8080 +# The log level of the backend application +LOG_LEVEL=INFO + ############################################################################################################## # Setup of API keys and secrets # Except for the NVD_API_KEY the variables can be filled with random keys! diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 7d83535..3a36d0a 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -4,7 +4,6 @@ services: user: "${RUNNER_UID}:${GID}" build: context: ./backend - target: dev env_file: "./backend/.env" environment: WORK_DIR: $WORK_DIR