pyles/Dockerfile

30 lines
694 B
Text
Raw Permalink Normal View History

2023-09-29 22:31:32 +02:00
FROM docker.io/python:3.11-alpine as python-base
ENV POETRY_VERSION=1.3.2
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
2023-10-01 03:39:06 +02:00
RUN apk add --no-cache tini libmagic
2023-09-29 22:31:32 +02:00
FROM python-base as poetry-base
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
FROM python-base as app
COPY --from=poetry-base ${POETRY_VENV} ${POETRY_VENV}
ENV PATH="${PATH}:${POETRY_VENV}/bin"
WORKDIR /app
COPY poetry.lock pyproject.toml ./
RUN poetry install --no-interaction --no-cache --without dev
COPY . /app
ENTRYPOINT ["/sbin/tini", "--"]
2023-10-01 03:39:06 +02:00
CMD ["sh", "./entry.sh"]