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.

42 lines
1007 B

  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. && rm -rf node_modules/
  18. COPY . /doccano
  19. FROM python:${PYTHON_VERSION}-slim AS runtime
  20. COPY --from=builder /deps /deps
  21. RUN pip install --no-cache-dir /deps/*.whl
  22. COPY --from=builder /doccano /doccano
  23. ENV DEBUG="True"
  24. ENV SECRET_KEY="change-me-in-production"
  25. ENV PORT="80"
  26. ENV WORKERS="2"
  27. ENV GOOGLE_TRACKING_ID=""
  28. ENV AZURE_APPINSIGHTS_IKEY=""
  29. WORKDIR /doccano
  30. EXPOSE ${PORT}
  31. CMD ["/doccano/tools/run.sh"]