feat: core func lab7

This commit is contained in:
Enterxx2
2026-11-24 14:04:04 +03:00
parent 4829fc7b4e
commit 411ca73aa0
83 changed files with 2883 additions and 523 deletions
+14 -7
View File
@@ -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