forked from mtusi2026/mtusi2026lab7
feat: core func lab7
This commit is contained in:
+14
-7
@@ -1,8 +1,7 @@
|
||||
FROM python:3.12.12-slim-bookworm
|
||||
FROM python:3.12.14-slim-bookworm AS dependencies
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=false
|
||||
ENV POETRY_VIRTUALENVS_IN_PROJECT=true \
|
||||
POETRY_NO_INTERACTION=1
|
||||
|
||||
WORKDIR /app
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
@@ -10,12 +9,20 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
COPY poetry.lock pyproject.toml ./
|
||||
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||
poetry config requests.max-retries 6 \
|
||||
&& poetry install --only main --no-root --no-interaction
|
||||
&& poetry install --only main --no-root
|
||||
|
||||
FROM python:3.12.14-slim-bookworm
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=dependencies /app/.venv /app/.venv
|
||||
COPY migrations ./migrations
|
||||
COPY src ./src
|
||||
|
||||
# Процесс работает не от root
|
||||
RUN useradd --system --uid 10001 --no-create-home app
|
||||
RUN useradd --uid 10001 --no-create-home app
|
||||
USER app
|
||||
|
||||
ARG APP_REVISION=dev
|
||||
|
||||
Reference in New Issue
Block a user