diff --git a/Dockerfile b/Dockerfile index e04377e..e4c78ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file + +# Copy application code +COPY . . + +# Default command (can be overridden in docker compose) +CMD ["uv", "run", "/app/bot.py"] + +