Files

26 lines
739 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM python:3.12-slim-bookworm
# uv для установки зависимостей строго по uv.lock
COPY --from=ghcr.io/astral-sh/uv:0.6 /uv /bin/uv
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/app/.venv \
PATH="/app/.venv/bin:$PATH" \
PYTHONUNBUFFERED=1 \
DB_PATH=/data/db.sqlite3
# Сначала только зависимости, чтобы слой кэшировался между сборками
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
COPY app ./app
# Каталог для SQLite. В Coolify/compose сюда монтируется постоянный том.
RUN mkdir -p /data
VOLUME ["/data"]
CMD ["python", "-m", "app"]