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.

62 lines
1.5 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. # hadolint ignore=DL3018
  8. RUN apk add -U --no-cache git python3 make g++ \
  9. && yarn install \
  10. && yarn build \
  11. && apk del --no-cache git make g++
  12. FROM python:${PYTHON_VERSION}-slim-buster AS backend-builder
  13. RUN apt-get update \
  14. && apt-get install -y --no-install-recommends \
  15. netcat=1.10-41.1 \
  16. libpq-dev=11.9-0+deb10u1 \
  17. unixodbc-dev=2.3.6-0.1 \
  18. g++=4:8.3.0-1 \
  19. && apt-get clean
  20. COPY /app/requirements.txt /
  21. # hadolint ignore=DL3013
  22. RUN pip install --no-cache-dir -U pip \
  23. && pip install --no-cache-dir -r /requirements.txt \
  24. && pip wheel --no-cache-dir -r /requirements.txt -w /deps
  25. FROM python:${PYTHON_VERSION}-slim-buster AS runtime
  26. RUN useradd -ms /bin/sh doccano
  27. RUN mkdir /data \
  28. && chown doccano:doccano /data
  29. COPY --from=backend-builder /deps /deps
  30. # hadolint ignore=DL3013
  31. RUN pip install --no-cache-dir -U pip \
  32. && pip install --no-cache-dir /deps/*.whl
  33. COPY --chown=doccano:doccano . /doccano
  34. WORKDIR /doccano
  35. COPY --from=frontend-builder /frontend/dist /doccano/app/client/dist
  36. RUN python app/manage.py collectstatic --noinput
  37. VOLUME /data
  38. ENV DATABASE_URL="sqlite:////data/doccano.db"
  39. ENV DEBUG="True"
  40. ENV SECRET_KEY="change-me-in-production"
  41. ENV PORT="8000"
  42. ENV WORKERS="2"
  43. ENV GOOGLE_TRACKING_ID=""
  44. ENV AZURE_APPINSIGHTS_IKEY=""
  45. USER doccano
  46. WORKDIR /doccano
  47. EXPOSE ${PORT}
  48. CMD ["/doccano/tools/run.sh"]