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.

39 lines
1013 B

  1. ARG PYTHON_VERSION="3.8.6"
  2. FROM python:${PYTHON_VERSION}-slim-buster
  3. CMD ["python3"]
  4. WORKDIR /backend
  5. ENV PYTHONDONTWRITEBYTECODE 1
  6. ENV PYTHONUNBUFFERED 1
  7. RUN groupadd -g 61000 doccano \
  8. && useradd -g 61000 -l -M -s /bin/false -u 61000 doccano
  9. COPY --chown=doccano:doccano ./backend/ /backend/
  10. COPY --chown=doccano:doccano ./Pipfile* /backend/
  11. # hadolint ignore=DL3013
  12. RUN apt-get update \
  13. && apt-get install -y --no-install-recommends \
  14. netcat=1.* \
  15. libpq-dev=11.* \
  16. unixodbc-dev=2.* \
  17. g++=4:* \
  18. && pip install --no-cache-dir pipenv==2020.11.15 \
  19. && pipenv install --system --deploy \
  20. && pip uninstall -y pipenv virtualenv-clone virtualenv \
  21. && apt-get clean \
  22. && rm -rf /var/lib/apt/lists/*
  23. COPY --chown=doccano:doccano tools/ /opt/bin/
  24. RUN mkdir -p /backend/staticfiles \
  25. && mkdir -p /backend/client/dist/static \
  26. && mkdir -p /backend/media \
  27. && chown -R doccano:doccano /backend/
  28. USER doccano:doccano
  29. VOLUME /backend/staticfiles
  30. ENTRYPOINT [ "/opt/bin/prod-django.sh" ]