# Install uv FROM python:3.13-slim COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ # Change the working directory to the `app` directory WORKDIR /app # Install dependencies RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --frozen --no-install-project # Copy the project into the image ADD main.py misc.py pyproject.toml /app/ # Sync the project RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen # Set the environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 # Run the application CMD ["uv", "run", "main.py"]