Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.13-slim-trixie
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using the floating tag latest for the uv image makes builds non-reproducible and can break unexpectedly when upstream updates. Pin to a specific version or digest, e.g., COPY --from=ghcr.io/astral-sh/uv:vX.Y.Z /uv /uvx /bin/ or use a @sha256 digest.

Suggested change
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:v0.1.23 /uv /uvx /bin/

Copilot uses AI. Check for mistakes.

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
graphviz \
&& rm -rf /var/lib/apt/lists/*

COPY . /app
WORKDIR /app

ENV UV_PROJECT_ENVIRONMENT=/venv
ENV PATH="/venv/bin:$PATH"
RUN uv sync --frozen
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
app:
build: .
tty: true
working_dir: /app
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The service does not define a command, which makes behavior depend on the base image default (currently python3). For predictable developer experience, specify an explicit command (e.g., bash, uv run your_app, or a dev server entrypoint) aligned with your workflow.

Suggested change
working_dir: /app
working_dir: /app
command: bash

Copilot uses AI. Check for mistakes.
volumes:
- .:/app
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bind mount of the project root to /app will shadow any files created at build time under /app, including the virtual environment created by uv sync in the Docker image (/app/.venv). This makes the layer from uv sync ineffective in dev containers. Consider either (a) moving the virtual environment outside /app (e.g., set ENV UV_PROJECT_ENVIRONMENT=/venv and ENV PATH="/venv/bin:$PATH" in the Dockerfile) or (b) mounting a named volume at /app/.venv in compose so it is not overridden by the bind mount.

Suggested change
- .:/app
- .:/app
- venv:/app/.venv
volumes:
venv:

Copilot uses AI. Check for mistakes.