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.

56 lines
1.4 KiB

  1. ARG PYTHON_VERSION="3.8.6"
  2. ARG NODE_VERSION="13.7"
  3. FROM node:${NODE_VERSION}-alpine AS frontend-builder
  4. COPY frontend/ /frontend/
  5. WORKDIR /frontend
  6. ENV PUBLIC_PATH="/static/_nuxt/"
  7. RUN apk add -U --no-cache git python3 make g++ \
  8. && yarn install \
  9. && yarn build \
  10. && apk del --no-cache git make g++
  11. FROM python:${PYTHON_VERSION}-slim-buster AS backend-builder
  12. RUN apt-get update && \
  13. apt-get install -y --no-install-recommends netcat libpq-dev unixodbc-dev g++ && \
  14. apt-get clean
  15. COPY /app/requirements.txt /
  16. RUN pip install --no-cache-dir -U pip \
  17. && pip install --no-cache-dir -r /requirements.txt \
  18. && pip wheel --no-cache-dir -r /requirements.txt -w /deps
  19. FROM python:${PYTHON_VERSION}-slim-buster AS runtime
  20. RUN useradd -ms /bin/sh doccano
  21. RUN mkdir /data \
  22. && chown doccano:doccano /data
  23. COPY --from=backend-builder /deps /deps
  24. # hadolint ignore=DL3013
  25. RUN pip install --no-cache-dir -U pip \
  26. && pip install --no-cache-dir /deps/*.whl
  27. COPY --chown=doccano:doccano . /doccano
  28. WORKDIR /doccano
  29. COPY --from=frontend-builder /frontend/dist /doccano/app/client/dist
  30. RUN python app/manage.py collectstatic --noinput
  31. VOLUME /data
  32. ENV DATABASE_URL="sqlite:////data/doccano.db"
  33. ENV DEBUG="True"
  34. ENV SECRET_KEY="change-me-in-production"
  35. ENV PORT="8000"
  36. ENV WORKERS="2"
  37. ENV GOOGLE_TRACKING_ID=""
  38. ENV AZURE_APPINSIGHTS_IKEY=""
  39. USER doccano
  40. WORKDIR /doccano
  41. EXPOSE ${PORT}
  42. CMD ["/doccano/tools/run.sh"]