-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.local
More file actions
44 lines (37 loc) · 1.94 KB
/
Dockerfile.local
File metadata and controls
44 lines (37 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# DevForge local-dev image.
#
# Single image runs the control plane (FastAPI on uvicorn) and serves as the
# host for worker subprocesses (scripts.run_ticket spawned per ticket). Source
# is bind-mounted at runtime — uvicorn --reload watches backend/ + scripts/.
# .venv lives on a named volume so deps survive container restarts.
#
# Build: docker compose build (or `make setup`)
# Run: docker compose up (or `make dev`)
FROM python:3.12-slim-bookworm
# git is required for orchestrator worktree management; curl + ca-certs for
# httpx callbacks to OpenRouter / GitHub / Clerk JWKS / control plane self-call.
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# uv installs into /usr/local/bin via the official installer.
ADD https://astral.sh/uv/install.sh /uv-install.sh
RUN sh /uv-install.sh && mv /root/.local/bin/uv /usr/local/bin/uv && rm /uv-install.sh
WORKDIR /app
# pyproject.toml + uv.lock are bind-mounted at runtime by docker-compose.yml,
# so we don't COPY them here — and we deliberately don't pre-warm the venv
# at build time. Pre-warming bakes a 1.5 GB layer that then has to be
# *copied* into the empty `cp_venv` named volume on first attach (slow on
# Apple Silicon's grpcfuse). Instead, the boot-time `uv sync` populates the
# empty volume directly, and the `uv_cache` named volume keeps PyPI wheels
# around so subsequent boots are fast.
ENV PYTHONUNBUFFERED=1 \
DEVFORGE_BACKEND=local \
UV_CACHE_DIR=/root/.cache/uv
EXPOSE 8001
# Boot-time: sync deps into the .venv volume (empty on first attach, then
# populated and persisted), then exec uvicorn with hot-reload.
CMD ["sh", "-c", "uv sync --frozen --all-extras 2>/dev/null || uv sync --all-extras && \
exec uv run uvicorn backend.control_plane.main:app \
--reload --host 0.0.0.0 --port 8001 \
--reload-dir backend --reload-dir scripts \
--reload-include '*.py'"]