From fca8b98c4fba355a2c90865801ba71575972a43f Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Thu, 16 May 2019 23:29:19 -0400 Subject: [PATCH] Introduce new layer to clean up build artifacts --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a3e1ad55..0cb8843a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,17 +24,22 @@ COPY . /doccano RUN cd /doccano \ && tools/ci.sh +FROM builder AS cleaner + RUN cd /doccano \ && python app/manage.py collectstatic --noinput -RUN rm -rf /doccano/app/server/node_modules/ +RUN rm -rf /doccano/app/server/node_modules/ \ + && rm -rf /doccano/app/server/static/ \ + && rm -rf /doccano/app/staticfiles/js/ \ + && find /doccano/app/staticfiles -type f -name '*.map*' -delete FROM python:${PYTHON_VERSION}-slim AS runtime COPY --from=builder /deps /deps RUN pip install --no-cache-dir /deps/*.whl -COPY --from=builder /doccano /doccano +COPY --from=cleaner /doccano /doccano ENV DEBUG="True" ENV SECRET_KEY="change-me-in-production"