2023-12-02 18:35:23 +00:00
|
|
|
FROM python:3.11-bookworm@sha256:ba7a7ac30c38e119c4304f98ef0e188f90f4f67a958bb6899da9defb99bfb471 as builder
|
2023-06-16 15:28:41 +00:00
|
|
|
|
2023-03-03 22:45:20 +00:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
2023-04-26 10:39:24 +00:00
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PIP_NO_CACHE_DIR=true
|
2023-03-01 15:37:12 +00:00
|
|
|
|
2023-06-05 14:40:48 +00:00
|
|
|
RUN pip install --upgrade pip && pip install poetry
|
|
|
|
RUN poetry config installer.max-workers 10 && \
|
|
|
|
poetry config virtualenvs.create false
|
2023-03-01 17:48:35 +00:00
|
|
|
RUN python -m venv /opt/venv
|
2023-06-05 14:40:48 +00:00
|
|
|
ENV VIRTUAL_ENV="/opt/venv" PATH="/opt/venv/bin:${PATH}"
|
2023-03-03 22:45:20 +00:00
|
|
|
|
2023-10-31 10:02:04 +00:00
|
|
|
COPY poetry.lock pyproject.toml ./
|
2023-06-05 14:40:48 +00:00
|
|
|
RUN poetry install --sync --no-interaction --no-ansi --no-root --only main
|
2023-03-01 17:48:35 +00:00
|
|
|
|
2023-12-04 19:26:41 +00:00
|
|
|
FROM python:3.11-slim-bookworm@sha256:cc758519481092eb5a4a5ab0c1b303e288880d59afc601958d19e95b300bc86b
|
2023-06-16 15:28:41 +00:00
|
|
|
|
2023-08-31 23:30:53 +00:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends tini libmimalloc2.0 && rm -rf /var/lib/apt/lists/*
|
2023-07-21 14:20:04 +00:00
|
|
|
|
2023-06-05 14:40:48 +00:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
ENV NODE_ENV=production \
|
|
|
|
TRANSFORMERS_CACHE=/cache \
|
2023-04-26 10:39:24 +00:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
2023-06-05 14:40:48 +00:00
|
|
|
PATH="/opt/venv/bin:$PATH" \
|
2023-06-25 03:18:09 +00:00
|
|
|
PYTHONPATH=/usr/src
|
2023-03-01 17:48:35 +00:00
|
|
|
|
2023-06-05 14:40:48 +00:00
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
2023-08-31 23:30:53 +00:00
|
|
|
COPY start.sh log_conf.json ./
|
2023-06-05 14:40:48 +00:00
|
|
|
COPY app .
|
2023-07-21 14:20:04 +00:00
|
|
|
ENTRYPOINT ["tini", "--"]
|
2023-08-31 23:30:53 +00:00
|
|
|
CMD ["./start.sh"]
|