You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

  1. ARG PYTHON_VERSION="3.6"
  2. FROM python:${PYTHON_VERSION} AS builder
  3. ARG NODE_VERSION="8.x"
  4. RUN curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}" | bash - \
  5. && apt-get install nodejs
  6. COPY app/server/static/package*.json /doccano/app/server/static/
  7. RUN cd /doccano/app/server/static \
  8. && npm ci
  9. COPY requirements.txt /
  10. RUN pip install -r /requirements.txt \
  11. && pip wheel -r /requirements.txt -w /deps
  12. COPY . /doccano
  13. RUN cd /doccano \
  14. && tools/ci.sh
  15. FROM builder AS cleaner
  16. RUN cd /doccano/app/server/static \
  17. && SOURCE_MAP=False DEBUG=False npm run build \
  18. && rm -rf components pages node_modules .*rc package*.json webpack.config.js
  19. RUN cd /doccano \
  20. && python app/manage.py collectstatic --noinput
  21. FROM python:${PYTHON_VERSION}-slim AS runtime
  22. COPY --from=builder /deps /deps
  23. RUN pip install --no-cache-dir /deps/*.whl
  24. COPY --from=cleaner /doccano /doccano
  25. ENV DEBUG="True"
  26. ENV SECRET_KEY="change-me-in-production"
  27. ENV PORT="80"
  28. ENV WORKERS="2"
  29. ENV GOOGLE_TRACKING_ID=""
  30. ENV AZURE_APPINSIGHTS_IKEY=""
  31. WORKDIR /doccano
  32. EXPOSE ${PORT}
  33. CMD ["/doccano/tools/run.sh"]