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.

46 lines
1.0 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. && rm -rf /var/lib/apt/lists/*
  7. COPY app/server/package*.json /doccano/app/server/
  8. RUN cd /doccano/app/server \
  9. && npm ci
  10. COPY requirements.txt /
  11. RUN pip install -r /requirements.txt \
  12. && pip wheel -r /requirements.txt -w /deps
  13. COPY app/server/static /doccano/app/server/static/
  14. COPY app/server/webpack.config.js /doccano/app/server/
  15. RUN cd /doccano/app/server \
  16. && DEBUG=False npm run build
  17. COPY . /doccano
  18. RUN cd /doccano \
  19. && tools/ci.sh
  20. RUN rm -rf /doccano/app/server/node_modules/
  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=builder /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"]