fix(docker,docs): improve production Docker config and update docs#2663
fix(docker,docs): improve production Docker config and update docs#2663zhoufengen wants to merge 1 commit intobytedance:mainfrom
Conversation
- Add IPv6 detection logic to production nginx command, matching the dev compose file behavior to prevent startup failures on systems without IPv6 support - Add healthchecks to gateway and frontend services in production docker-compose.yaml for reliable startup ordering - Add missing start_period to provisioner healthcheck in production config, matching dev compose file - Update CONTRIBUTING.md project structure to reflect actual directory layout (backend/app/ and backend/packages/harness/deerflow/) - Update CONTRIBUTING.md architecture diagrams to reflect Gateway embedded runtime (no separate LangGraph Server on port 2024) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
There was a problem hiding this comment.
Pull request overview
Aligns the production Docker Compose setup with the dev environment’s nginx startup behavior and adds readiness gating via healthchecks, while updating CONTRIBUTING.md to reflect the current “Gateway-embedded agent runtime” architecture and repository layout.
Changes:
- Updated production nginx container command to match dev behavior (including IPv6 listen-line removal when IPv6 isn’t available).
- Added healthchecks to
frontendandgateway, and switched nginxdepends_ontocondition: service_healthy; added missingstart_periodto provisioner healthcheck. - Updated
CONTRIBUTING.mdarchitecture notes/diagrams and project structure tree to remove the outdated standalone LangGraph server references.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docker/docker-compose.yaml | Adds nginx IPv6 detection logic, introduces service healthchecks, and gates nginx startup on healthy gateway/frontend. |
| CONTRIBUTING.md | Updates docs to reflect embedded runtime in Gateway and corrects backend directory structure. |
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:3000"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 6 | ||
| start_period: 15s |
There was a problem hiding this comment.
The new frontend healthcheck uses curl, but the frontend production image is node:22-alpine and does not include curl by default. This will make the healthcheck fail (exit 127) and, because nginx now uses condition: service_healthy, nginx will never start. Consider switching the healthcheck to a command available in the image (e.g., Node's built-in fetch) or explicitly installing curl in the frontend prod image.
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8001/health"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 6 | ||
| start_period: 15s |
There was a problem hiding this comment.
The new gateway healthcheck uses curl, but the gateway service builds the backend Dockerfile default (runtime) stage which does not install curl (only the builder stage does). This will cause the healthcheck to fail and block nginx startup due to depends_on: condition: service_healthy. Either install curl in the runtime stage or change the healthcheck to use Python (available in the image) to request http://localhost:8001/health.
|
@zhoufengen, thanks for the contribution. Please verify the change on your local box first before sending out the PR. |
Summary
Fixes several inconsistencies between the production and dev Docker Compose configurations, and updates outdated documentation in CONTRIBUTING.md.
Changes
Docker (
docker/docker-compose.yaml)Add IPv6 detection to production nginx command — The dev compose file (
docker-compose-dev.yaml) includes logic to striplisten [::]:2026when/proc/net/if_inet6is absent, preventing nginx startup failures on systems without IPv6 support. The production compose file was missing this. Now both files use the same pattern.Add healthchecks to gateway and frontend services — The nginx service depends on gateway and frontend, but without healthchecks there was no way to ensure they were actually ready before nginx started. Added healthchecks (matching the pattern used by the provisioner service) and updated nginx's
depends_onto usecondition: service_healthy.Add missing
start_periodto provisioner healthcheck — The dev compose file includesstart_period: 15sfor the provisioner healthcheck, but the production file was missing it. This gives the provisioner time to initialize before health checks begin failing.Documentation (
CONTRIBUTING.md)Update project structure tree — The documented structure referenced a non-existent
backend/src/directory. Updated to reflect the actual layout:backend/app/(gateway, channels) andbackend/packages/harness/deerflow/(agents, sandbox, models, skills, etc.).Update architecture diagrams — Removed references to a separate LangGraph Server on port 2024, which no longer exists in DeerFlow 2.0. The agent runtime is now embedded in the Gateway on port 8001. Updated the Docker Architecture diagram, the main Architecture diagram, the Manual Service Control section, and the Nginx Configuration description.
Testing
docker-compose.yaml