Skip to content

Commit 8f84895

Browse files
committed
Separate clean image Dockerfile layers
1 parent ac433dc commit 8f84895

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

{{cookiecutter.project_dirname}}/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ RUN apt-get update \
2828
libc6-dev \
2929
libpq-dev \
3030
&& su $APPUSER -c "python3 -m pip install --no-cache-dir -r requirements/base.txt" \
31-
&& find ${PACKAGES_PATH} -regex '^.*/locale/.*/*.\(mo\|po\)$' -not -path '*/en*' -not -path '*/it*' -delete || true \
3231
&& apt-get purge --assume-yes --auto-remove \
3332
gcc \
3433
libc6-dev \
3534
libpq-dev \
3635
&& rm -rf /var/lib/apt/lists/*
3736
COPY --chown=$APPUSER ./requirements/common.txt requirements/common.txt
38-
RUN su $APPUSER -c "python3 -m pip install --no-cache-dir -r requirements/common.txt" \
39-
&& find ${PACKAGES_PATH} -regex '^.*/locale/.*/*.\(mo\|po\)$' -not -path '*/en*' -not -path '*/it*' -delete || true
37+
RUN su $APPUSER -c "python3 -m pip install --no-cache-dir -r requirements/common.txt"
38+
RUN find ${PACKAGES_PATH} -regex '^.*/locale/.*/*.\(mo\|po\)$' -not -path '*/en*' -not -path '*/it*' -delete || true
4039

4140
FROM base AS test
4241

@@ -55,8 +54,8 @@ ENV DJANGO_CONFIGURATION=Remote INTERNAL_SERVICE_PORT={{ cookiecutter.internal_s
5554
USER $APPUSER
5655
ARG PACKAGES_PATH=${VIRTUAL_ENV}/lib/python3.12/site-packages
5756
COPY --chown=$APPUSER ./requirements/remote.txt requirements/remote.txt
58-
RUN python3 -m pip install --no-cache-dir -r requirements/remote.txt \
59-
&& find ${PACKAGES_PATH}/boto*/data/* -maxdepth 0 -type d -not -name s3* -exec rm -rf {} \; || true
57+
RUN python3 -m pip install --no-cache-dir -r requirements/remote.txt
58+
RUN find ${PACKAGES_PATH}/boto*/data/* -maxdepth 0 -type d -not -name s3* -exec rm -rf {} \; || true
6059
COPY --chown=$APPUSER . .
6160
RUN DJANGO_SECRET_KEY=build python3 -m manage collectstatic --clear --link --noinput
6261
ENTRYPOINT ["./scripts/entrypoint.sh"]
@@ -79,8 +78,8 @@ RUN apt-get update \
7978
postgresql-client
8079
USER $APPUSER
8180
COPY --chown=$APPUSER ./requirements/local.txt requirements/local.txt
82-
RUN python3 -m pip install --no-cache-dir -r requirements/local.txt \
83-
&& find ${PACKAGES_PATH} -regex '^.*/locale/.*/*.\(mo\|po\)$' -not -path '*/en*' -not -path '*/it*' -delete || true
81+
RUN python3 -m pip install --no-cache-dir -r requirements/local.txt
82+
RUN find ${PACKAGES_PATH} -regex '^.*/locale/.*/*.\(mo\|po\)$' -not -path '*/en*' -not -path '*/it*' -delete || true
8483
COPY --chown=$APPUSER . .
8584
RUN DJANGO_SECRET_KEY=build python3 -m manage collectstatic --clear --link --noinput
8685
ENTRYPOINT ["./scripts/entrypoint.sh"]

0 commit comments

Comments
 (0)