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"