Browse Source

Introduce new layer to clean up build artifacts

pull/207/head
Clemens Wolff 5 years ago
parent
commit
fca8b98c4f
1 changed files with 7 additions and 2 deletions
  1. 9
      Dockerfile

9
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"

Loading…
Cancel
Save