From 63f3df1d5ce437ee6dfb345d49b0ad48f589bc77 Mon Sep 17 00:00:00 2001 From: tcely Date: Fri, 28 Feb 2025 12:45:36 -0500 Subject: [PATCH] Clean up __pycache__ directories --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7376bbb5..bccfca16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -297,6 +297,9 @@ RUN --mount=type=tmpfs,target=/cache \ --mount=type=cache,id=apt-cache-cache,sharing=locked,target=/var/cache/apt \ --mount=type=bind,source=Pipfile,target=/app/Pipfile \ set -x && \ + # Remove __pycache__ directories from image + PYTHONPYCACHEPREFIX=/tmp/pycache && \ + export PYTHONPYCACHEPREFIX && \ # Update from the network and keep cache rm -f /etc/apt/apt.conf.d/docker-clean && \ apt-get update && \ @@ -349,9 +352,14 @@ COPY tubesync/tubesync/local_settings.py.container /app/tubesync/local_settings. RUN set -x && \ # Make absolutely sure we didn't accidentally bundle a SQLite dev database rm -rf /app/db.sqlite3 && \ + # Remove __pycache__ directories from image + PYTHONPYCACHEPREFIX=/tmp/pycache && \ + export PYTHONPYCACHEPREFIX && \ # Run any required app commands /usr/bin/python3 -B /app/manage.py compilescss && \ /usr/bin/python3 -B /app/manage.py collectstatic --no-input --link && \ + # Clean up + rm -v -rf /tmp/* && \ # Create config, downloads and run dirs mkdir -v -p /run/app && \ mkdir -v -p /config/media && \