dockerfile

This commit is contained in:
2026-01-28 15:35:07 +03:00
parent a7bb6db060
commit a2b525f997

View File

@ -1,12 +1,34 @@
FROM python:3.12.7-alpine
# Dockerfile for backend development
FROM python:3.12-slim as base
# Set working directory
WORKDIR /app
ADD https://github.com/astral-sh/uv/releases/download/0.9.27/uv-installer.sh /uv-installer.sh
RUN sh /uv-installer.sh
ENV PATH="/root/.cargo/bin/:$PATH"
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
ADD pyproject.toml .
ADD uv.lock .
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set uv link mode to copy (for Docker volumes)
ENV UV_LINK_MODE=copy
# Development stage
FROM base as development
# Copy dependency files
COPY pyproject.toml uv.lock ./
# Install dependencies
RUN uv sync --frozen
ADD . .
CMD ["/root/.cargo/bin/uv", "run", "python", "/app/bot.py"]
# Copy application code
COPY . .
# Default command (can be overridden in docker compose)
CMD ["uv", "run", "/app/bot.py"]