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.

41 lines
1.0 KiB

  1. ARG PYTHON_VERSION="3.8.12-slim-buster"
  2. FROM python:${PYTHON_VERSION}
  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 ./Pipfile* /backend/
  10. # hadolint ignore=DL3013
  11. RUN apt-get update \
  12. && apt-get install -y --no-install-recommends \
  13. netcat=1.* \
  14. libpq-dev=11.* \
  15. unixodbc-dev=2.* \
  16. g++=4:* \
  17. && pip install --upgrade pip \
  18. && pip install --no-cache-dir pipenv \
  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. COPY --chown=doccano:doccano ./backend/ /backend/
  29. USER doccano:doccano
  30. VOLUME /backend/staticfiles
  31. ENTRYPOINT [ "/opt/bin/prod-django.sh" ]