Dockerfile 605 B

1234567891011121314151617181920212223
  1. FROM python:3.12-alpine as base
  2. ENV LANG=C.UTF-8
  3. ENV LC_ALL=C.UTF-8
  4. ENV PYTHONUNBUFFERED=1
  5. RUN adduser --system --no-create-home kinema-zetel
  6. RUN mkdir /app
  7. WORKDIR /app
  8. RUN --mount=type=cache,target=/root/.cache/pip pip install -U pip pip-tools
  9. USER root
  10. FROM base as prod
  11. COPY requirements.txt /app/requirements.txt
  12. RUN pip install -r requirements.txt
  13. RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
  14. COPY . .
  15. RUN --mount=type=cache,target=/root/.cache/pip pip install -e . --no-deps
  16. USER kinema-zetel
  17. CMD [ "python", "-m", "kinema-zetel"]
  18. from prod as dev
  19. USER root