-
Notifications
You must be signed in to change notification settings - Fork 0
Add Dockerfile and docker-compose.yml (#8) #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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/ | ||
|
|
||
| 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 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||||||||||
| services: | ||||||||||||||
| app: | ||||||||||||||
| build: . | ||||||||||||||
| tty: true | ||||||||||||||
| working_dir: /app | ||||||||||||||
|
||||||||||||||
| working_dir: /app | |
| working_dir: /app | |
| command: bash |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
| - .:/app | |
| - .:/app | |
| - venv:/app/.venv | |
| volumes: | |
| venv: |
There was a problem hiding this comment.
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.