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.

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