2023-06-16 18:17:23 +02:00
|
|
|
FROM python:3.11.4-bullseye@sha256:5b401676aff858495a5c9c726c60b8b73fe52833e9e16eccdb59e93d52741727 as builder
|
2023-06-16 17:28:41 +02:00
|
|
|
|
2023-03-04 00:45:20 +02:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
2023-04-26 12:39:24 +02:00
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PIP_NO_CACHE_DIR=true
|
2023-03-01 17:37:12 +02:00
|
|
|
|
2023-06-05 16:40:48 +02:00
|
|
|
RUN pip install --upgrade pip && pip install poetry
|
|
|
|
RUN poetry config installer.max-workers 10 && \
|
|
|
|
poetry config virtualenvs.create false
|
2023-03-01 19:48:35 +02:00
|
|
|
RUN python -m venv /opt/venv
|
2023-06-05 16:40:48 +02:00
|
|
|
ENV VIRTUAL_ENV="/opt/venv" PATH="/opt/venv/bin:${PATH}"
|
2023-03-04 00:45:20 +02:00
|
|
|
|
2023-08-25 06:28:51 +02:00
|
|
|
COPY poetry.lock pyproject.toml requirements.txt ./
|
2023-06-05 16:40:48 +02:00
|
|
|
RUN poetry install --sync --no-interaction --no-ansi --no-root --only main
|
2023-08-25 06:28:51 +02:00
|
|
|
RUN pip install --no-deps -r requirements.txt
|
2023-03-01 19:48:35 +02:00
|
|
|
|
2023-06-16 18:38:59 +02:00
|
|
|
FROM python:3.11.4-slim-bullseye@sha256:91d194f58f50594cda71dcd2e8fdefd90e7ecc57d07823813b67c8521e565dcd
|
2023-06-16 17:28:41 +02:00
|
|
|
|
2023-07-21 16:20:04 +02:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends tini && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2023-06-05 16:40:48 +02:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
ENV NODE_ENV=production \
|
|
|
|
TRANSFORMERS_CACHE=/cache \
|
2023-04-26 12:39:24 +02:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
2023-06-05 16:40:48 +02:00
|
|
|
PATH="/opt/venv/bin:$PATH" \
|
2023-06-25 05:18:09 +02:00
|
|
|
PYTHONPATH=/usr/src
|
2023-03-01 19:48:35 +02:00
|
|
|
|
2023-06-05 16:40:48 +02:00
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
|
|
|
COPY app .
|
2023-07-21 16:20:04 +02:00
|
|
|
ENTRYPOINT ["tini", "--"]
|
|
|
|
CMD ["python", "-m", "app.main"]
|