Skip to content

fix(docker,docs): improve production Docker config and update docs#2663

Open
zhoufengen wants to merge 1 commit intobytedance:mainfrom
zhoufengen:fix/docker-and-docs-improvements
Open

fix(docker,docs): improve production Docker config and update docs#2663
zhoufengen wants to merge 1 commit intobytedance:mainfrom
zhoufengen:fix/docker-and-docs-improvements

Conversation

@zhoufengen
Copy link
Copy Markdown

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)

  1. Add IPv6 detection to production nginx command — The dev compose file (docker-compose-dev.yaml) includes logic to strip listen [::]:2026 when /proc/net/if_inet6 is absent, preventing nginx startup failures on systems without IPv6 support. The production compose file was missing this. Now both files use the same pattern.

  2. 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_on to use condition: service_healthy.

  3. Add missing start_period to provisioner healthcheck — The dev compose file includes start_period: 15s for 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)

  1. Update project structure tree — The documented structure referenced a non-existent backend/src/ directory. Updated to reflect the actual layout: backend/app/ (gateway, channels) and backend/packages/harness/deerflow/ (agents, sandbox, models, skills, etc.).

  2. 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

  • Verified YAML syntax of the modified docker-compose.yaml
  • Changes are configuration/documentation only; no code logic changes

- 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>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 30, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 frontend and gateway, and switched nginx depends_on to condition: service_healthy; added missing start_period to provisioner healthcheck.
  • Updated CONTRIBUTING.md architecture 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.

Comment on lines +67 to +72
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 6
start_period: 15s
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +130
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 10s
timeout: 5s
retries: 6
start_period: 15s
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@WillemJiang WillemJiang added the question Further information is requested label Apr 30, 2026
@WillemJiang
Copy link
Copy Markdown
Collaborator

@zhoufengen, thanks for the contribution. Please verify the change on your local box first before sending out the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants