2023-12-25 22:37:48 -05:00
|
|
|
FROM python:3.11-bookworm@sha256:291405e32318285d8913b7b03293777c255fb1e89305c82aa495ac747b0049fe as builder
|
2023-06-16 10:28:41 -05:00
|
|
|
|
2023-03-03 17:45:20 -05:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
2023-04-26 05:39:24 -05:00
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PIP_NO_CACHE_DIR=true
|
2023-03-01 10:37:12 -05:00
|
|
|
|
2023-06-05 09:40:48 -05:00
|
|
|
RUN pip install --upgrade pip && pip install poetry
|
|
|
|
RUN poetry config installer.max-workers 10 && \
|
|
|
|
poetry config virtualenvs.create false
|
2023-03-01 12:48:35 -05:00
|
|
|
RUN python -m venv /opt/venv
|
2023-06-05 09:40:48 -05:00
|
|
|
ENV VIRTUAL_ENV="/opt/venv" PATH="/opt/venv/bin:${PATH}"
|
2023-03-03 17:45:20 -05:00
|
|
|
|
2023-10-31 05:02:04 -05:00
|
|
|
COPY poetry.lock pyproject.toml ./
|
2023-06-05 09:40:48 -05:00
|
|
|
RUN poetry install --sync --no-interaction --no-ansi --no-root --only main
|
2023-03-01 12:48:35 -05:00
|
|
|
|
2023-12-25 22:37:48 -05:00
|
|
|
FROM python:3.11-slim-bookworm@sha256:8f64a67710f3d981cf3008d6f9f1dbe61accd7927f165f4e37ea3f8b883ccc3f
|
2023-06-16 10:28:41 -05:00
|
|
|
|
2023-08-31 18:30:53 -05:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends tini libmimalloc2.0 && rm -rf /var/lib/apt/lists/*
|
2023-07-21 09:20:04 -05:00
|
|
|
|
2023-06-05 09:40:48 -05:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
ENV NODE_ENV=production \
|
|
|
|
TRANSFORMERS_CACHE=/cache \
|
2023-04-26 05:39:24 -05:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
2023-06-05 09:40:48 -05:00
|
|
|
PATH="/opt/venv/bin:$PATH" \
|
2023-06-24 22:18:09 -05:00
|
|
|
PYTHONPATH=/usr/src
|
2023-03-01 12:48:35 -05:00
|
|
|
|
2023-12-16 21:30:29 -05:00
|
|
|
# prevent core dumps
|
|
|
|
RUN echo "hard core 0" >> /etc/security/limits.conf && \
|
|
|
|
echo "fs.suid_dumpable 0" >> /etc/sysctl.conf && \
|
|
|
|
echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
|
|
|
|
|
2023-06-05 09:40:48 -05:00
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
2023-08-31 18:30:53 -05:00
|
|
|
COPY start.sh log_conf.json ./
|
2023-06-05 09:40:48 -05:00
|
|
|
COPY app .
|
2023-07-21 09:20:04 -05:00
|
|
|
ENTRYPOINT ["tini", "--"]
|
2023-08-31 18:30:53 -05:00
|
|
|
CMD ["./start.sh"]
|