diff --git a/Dockerfile b/Dockerfile index 19a42f83e..bfaa937b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ # pull official base image FROM python:3.12-slim-bookworm +# Overridden in docker-compose.yml to fix tox in Docker +ARG KEEP_DEPENDENCIES=False + # set work directory WORKDIR /usr/src/app @@ -34,11 +37,13 @@ RUN apt-get update \ libpq-dev \ zlib1g-dev \ && python3 -m pip install --no-cache-dir -r ${REQ_FILE} \ - && apt-get purge --assume-yes --auto-remove \ + && if [ "${KEEP_DEPENDENCIES}" = "True" ]; then \ + apt-get purge --assume-yes --auto-remove \ gcc \ libc6-dev \ libpq-dev \ - zlib1g-dev \ + zlib1g-dev; \ + fi \ && rm -rf /var/lib/apt/lists/* # install node dependencies diff --git a/docker-compose.yml b/docker-compose.yml index 8f875e2b5..0730523cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ services: dockerfile: Dockerfile args: - REQ_FILE=requirements/tests.txt + - KEEP_DEPENDENCIES=True entrypoint: ./docker-entrypoint.dev.sh command: python manage.py runserver 0.0.0.0:8000 volumes: