Skip to content

fix(hosting): scope gh.local traefik to its own compose project#4703

Open
mmabrouk wants to merge 2 commits into
mainfrom
fix/ghlocal-traefik-project-constraint
Open

fix(hosting): scope gh.local traefik to its own compose project#4703
mmabrouk wants to merge 2 commits into
mainfrom
fix/ghlocal-traefik-project-constraint

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

Context

Running two stacks on one host breaks the web UI. The gh.local EE stack starts traefik with --providers.docker and no constraint, so traefik watches every container on the Docker host, not just its own. When a second compose stack runs on the same machine, both stacks' routers claim the same hostnames. traefik cannot tell them apart, the web service hangs, and the page returns HTTP 000.

Changes

Add a Docker provider constraint so each stack's traefik only routes containers from its own compose project.

- --providers.docker.constraints=Label(`com.docker.compose.project`,`${COMPOSE_PROJECT_NAME:-agenta-ee-gh-local}`)

It reads COMPOSE_PROJECT_NAME and falls back to agenta-ee-gh-local, the default project name for this file. A single-stack setup behaves exactly as before.

Tests / notes

  • Single stack: unchanged. traefik still routes the web and API.
  • Two stacks on one host: each stack's traefik now ignores the other's containers, so the cross-project router collision that returned HTTP 000 on the web service goes away.

One-line config change. No application code is affected.

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 17, 2026 6:49pm

Request Review

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 21bb8c04-1315-406a-880f-cc9d41fabdce

📥 Commits

Reviewing files that changed from the base of the PR and between e1df24c and 1465b06.

📒 Files selected for processing (4)
  • hosting/docker-compose/ee/docker-compose.gh.yml
  • hosting/docker-compose/oss/docker-compose.gh.local.yml
  • hosting/docker-compose/oss/docker-compose.gh.yml
  • hosting/docker-compose/oss/ssl/traefik.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated Traefik Docker provider settings across Compose variants to scope container discovery to the active Compose project name (with sensible defaults), improving routing isolation in local and deployed environments.
    • Adjusted SSL Traefik provider configuration to use label-based container scoping instead of an unconstrained default.

Walkthrough

Adds identical Docker provider constraints to Traefik service commands across five Compose configuration files (EE GitHub local/production, OSS GitHub local/production, and OSS SSL). Each constraint restricts Traefik's Docker provider discovery to containers labeled with the active Compose project name, defaulting to the respective environment name when COMPOSE_PROJECT_NAME is unset.

Changes

Traefik Docker Provider Project Scoping

Layer / File(s) Summary
Add Traefik Docker provider constraints across all environments
hosting/docker-compose/ee/docker-compose.gh.local.yml, hosting/docker-compose/ee/docker-compose.gh.yml, hosting/docker-compose/oss/docker-compose.gh.local.yml, hosting/docker-compose/oss/docker-compose.gh.yml, hosting/docker-compose/oss/ssl/traefik.yml
Adds --providers.docker.constraints=Label(com.docker.compose.project, ...) to the traefik command in all Compose configurations, scoping container discovery to the current Compose project name (defaulting to agenta-ee-gh-local, agenta-ee-gh, agenta-oss-gh-local, agenta-oss-gh, or agenta-gh-ssl respectively).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding project scoping to traefik configurations. However, it specifically mentions only 'gh.local' while the changeset applies the constraint across all traefik instances (gh.local, gh, and SSL variants for both EE and OSS stacks).
Description check ✅ Passed The description is directly related to the changeset, providing context about the multi-stack routing collision issue and explaining the solution of adding Docker provider constraints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ghlocal-traefik-project-constraint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jp-agenta jp-agenta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mmabrouk
Could you please extend it to all the docker compose files in the hosting/?

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 15, 2026
@mmabrouk

Copy link
Copy Markdown
Member Author

@jp-agenta extended the Traefik Docker-provider project constraint to the remaining hosting/ compose stacks that use the Docker provider. Each Traefik instance now only discovers containers from its own compose project, preventing cross-project router collisions when multiple stacks share a host.

Files changed in this push:

  • hosting/docker-compose/oss/docker-compose.gh.local.yml--providers.docker.constraints=Label(com.docker.compose.project,${COMPOSE_PROJECT_NAME:-agenta-oss-gh-local})
  • hosting/docker-compose/oss/docker-compose.gh.yml--providers.docker.constraints=Label(com.docker.compose.project,${COMPOSE_PROJECT_NAME:-agenta-oss-gh})
  • hosting/docker-compose/ee/docker-compose.gh.yml--providers.docker.constraints=Label(com.docker.compose.project,${COMPOSE_PROJECT_NAME:-agenta-ee-gh})
  • hosting/docker-compose/oss/ssl/traefik.yml — this stack (agenta-gh-ssl) configures Traefik via a mounted static YAML file rather than CLI flags and has no command:. Added the equivalent static-config form: providers.docker.constraints: "Label(com.docker.compose.project,agenta-gh-ssl)". The static file is read by Traefik (not docker compose), so it cannot use ${COMPOSE_PROJECT_NAME:-...} defaulting; the literal project name matches the file's name:.

Already had the constraint (left untouched):

  • hosting/docker-compose/oss/docker-compose.dev.yml (agenta-oss-dev)
  • hosting/docker-compose/ee/docker-compose.dev.yml (agenta-ee-dev)
  • hosting/docker-compose/ee/docker-compose.gh.local.yml (the original fix in this PR)

I verified all edited files still parse as YAML.

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

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants