deerflow2/docker
yangzheli e1ebb9d434 fix(docker): use multi-stage build to remove build-essential from runtime image (#1846)
* fix(docker): use multi-stage build to remove build-essential from runtime image

The build-essential toolchain (~200 MB) was only needed for compiling
native Python extensions during `uv sync` but remained in the final
image, increasing size and attack surface. Split the Dockerfile into
a builder stage (with build-essential) and a clean runtime stage that
copies only the compiled artifacts, Node.js, Docker CLI, and uv.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(docker): add dev stage and pin docker:cli per review feedback

Address Copilot review comments:
- Add a `dev` build stage (FROM builder) that retains build-essential
  so startup-time `uv sync` in dev containers can compile from source
- Update docker-compose-dev.yaml to use `target: dev` for gateway and
  langgraph services
- Keep the clean runtime stage (no build-essential) as the default
  final stage for production builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 15:30:34 +08:00
..
nginx fix: remove nginx Plus-only zone/resolve directives from nginx.conf (#1837) 2026-04-04 11:03:22 +08:00
provisioner fix Windows Docker sandbox path mounting (#1634) 2026-03-31 22:19:27 +08:00
docker-compose-dev.yaml fix(docker): use multi-stage build to remove build-essential from runtime image (#1846) 2026-04-05 15:30:34 +08:00
docker-compose.yaml fix: unblock concurrent threads and workspace hydration (#1839) 2026-04-04 21:19:35 +08:00