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.

57 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 upgrade -y && \
  14. apt-get install -y --no-install-recommends netcat libpq-dev unixodbc-dev g++ && \
  15. apt-get clean
  16. COPY /app/requirements.txt /
  17. RUN pip install --no-cache-dir -U pip \
  18. && pip install --no-cache-dir -r /requirements.txt \
  19. && pip wheel --no-cache-dir -r /requirements.txt -w /deps
  20. FROM python:${PYTHON_VERSION}-slim-buster AS runtime
  21. RUN useradd -ms /bin/sh doccano
  22. RUN mkdir /data \
  23. && chown doccano:doccano /data
  24. COPY --from=backend-builder /deps /deps
  25. # hadolint ignore=DL3013
  26. RUN pip install --no-cache-dir -U pip \
  27. && pip install --no-cache-dir /deps/*.whl
  28. COPY --chown=doccano:doccano . /doccano
  29. WORKDIR /doccano
  30. COPY --from=frontend-builder /frontend/dist /doccano/app/client/dist
  31. RUN python app/manage.py collectstatic --noinput
  32. VOLUME /data
  33. ENV DATABASE_URL="sqlite:////data/doccano.db"
  34. ENV DEBUG="True"
  35. ENV SECRET_KEY="change-me-in-production"
  36. ENV PORT="8000"
  37. ENV WORKERS="2"
  38. ENV GOOGLE_TRACKING_ID=""
  39. ENV AZURE_APPINSIGHTS_IKEY=""
  40. USER doccano
  41. WORKDIR /doccano
  42. EXPOSE ${PORT}
  43. CMD ["/doccano/tools/run.sh"]