2023-06-16 17:28:41 +02:00
|
|
|
FROM python:3.11.4-bullseye@sha256:bede19c9a8999a5461a01a6c0e0893eaf3e712fccb28f547ba9d3391310f378b as builder
|
|
|
|
|
2023-03-03 23:45:20 +01:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
2023-04-26 12:39:24 +02:00
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PIP_NO_CACHE_DIR=true
|
2023-03-01 16:37:12 +01: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 18:48:35 +01: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-03 23:45:20 +01:00
|
|
|
|
2023-06-05 16:40:48 +02:00
|
|
|
COPY poetry.lock pyproject.toml ./
|
|
|
|
RUN poetry install --sync --no-interaction --no-ansi --no-root --only main
|
2023-03-01 18:48:35 +01:00
|
|
|
|
2023-06-16 17:28:41 +02:00
|
|
|
FROM python:3.11.4-slim-bullseye@sha256:4102cb4b15a5c0c52068d3128f87b1d43e6a3b431714f4a65e8b8e91750c7c54
|
|
|
|
|
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" \
|
|
|
|
PYTHONPATH=`pwd`
|
2023-03-01 18:48:35 +01:00
|
|
|
|
2023-06-05 16:40:48 +02:00
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
|
|
|
COPY app .
|
|
|
|
ENTRYPOINT ["python", "main.py"]
|