Manually attaching services to dokploy-network silently causes cross-project DNS collisions (service short name round-robins across stacks)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, docker-compose, typescript
- Lĩnh vực
- devops, infrastructure
Hướng nghiên cứu
Start by tracing where Compose stacks are processed during deployment, as the issue does not name specific files or entry points. Compare the proposed deploy warning and documentation note to determine which change is in scope, then inspect how services attach to dokploy-network. Done means preventing or clearly documenting cross-project short-name DNS collisions; the issue offers no named test to run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When a Compose stack attaches its services to the shared dokploy-network (declaring it external: true and listing it under a service's networks:, as many community templates and examples do), Docker Compose registers each service under its bare short name as a network-scoped alias on that shared overlay. Every project does the same, so a lookup of a common name like api, web, worker, redis or postgres resolves round-robin across every stack's container with that name. A server-side call such as fetch('http://api:8000/...') then reaches a different project's container at random: connection refused, a 404 from an unrelated app, or (worse) a silent success against the wrong database.
This is the same class of problem as #1004 (closed via Isolated Deployments), but it still bites anyone who attaches dokploy-network manually, which is common and shown in many examples. The failure is intermittent and very hard to diagnose, because most requests happen to hit the right container.
Minimal reproduction
Two separate Compose apps, each:
services:
api:
image: hashicorp/http-echo
command: ["-text=STACK-A"] # STACK-B in the other app
networks: [default, dokploy-network]
networks:
dokploy-network:
external: true
Deploy both. From any container on dokploy-network:
for i in $(seq 10); do getent hosts api; done # returns BOTH stacks' IPs, round-robin
A consumer hard-coded to http://api:<port> gets whichever stack answers that lookup, non-deterministically.
Root cause
Docker Compose always adds the service name as a network-scoped alias on every network the service joins, including an external shared one. On a single flat overlay shared by all projects, those aliases collide, and Docker's embedded DNS returns all matching A records and round-robins between them. (Background: Docker Forums, "Networking Two Compose Stacks - Round Robin Behaviour".)
Impact
- Intermittent, non-deterministic failures that look like application bugs. I traced an app that randomly rendered an empty page to this; roughly 1 request in N hit a stranger's container.
- A soft isolation concern: one stack can reach another stack's internal-only service (for example its database) by using a common service name.
Suggested fixes (any subset)
- Warn at deploy time when a stack attaches services to
dokploy-networkand a service short name already exists on that network from another project, e.g. a single log line:service name `api` also exists on dokploy-network from project X; use Isolated Deployments or a unique alias. That alone would save people hours. - Document the footgun on the Compose utilities / networking pages: if you attach
dokploy-networkmanually, inter-service URLs must use a globally unique name, not the bare service name. Minimal pattern:services: api: networks: default: aliases: [myproject-api] dokploy-network: aliases: [myproject-api] # consumer uses http://myproject-api:8000 - Keep the bare name off the shared network entirely. When Dokploy attaches
dokploy-network, consider connecting it outside the Compose servicenetworks:list, viadocker network connect --alias <project>-<service> <container> dokploy-network.docker network connectdoes not add the Compose service name as an alias, so the collision never forms, while Traefik (which routes by container IP) is unaffected. - Consider making Isolated Deployments the default for new Compose apps.
Environment
- Dokploy, self-hosted. Multiple Compose stacks sharing
dokploy-networkon one host.
Happy to send a PR for the docs note (fix 2) and/or the duplicate-alias deploy warning (fix 1) if you can point me at where Compose processing happens in the deploy path.
- Ngôn ngữ chính
- TypeScript
- Star
- 38.8k
- Fork
- 3.2k
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 110
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Dokploy/dokploy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6151 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Healthy Swarm task shows an empty `(Error:)` suffix on the last row of the Containers tabCó thể đã có người làm @AyhamJo7 đã nhận 4 ngày trước. Đang mởneeds-triage🔍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Dokploy/dokploy#6115 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Global search (Cmd/Ctrl+J) never sorts results by relevanceCó thể đã có người làm @hamidzr đã nhận 6 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Dokploy/dokploy#6107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`utils/dns/ovh.ts`: the zone-listing 403 handler replaces the provider's error instead of chaining itCó thể đã có người làm @SyncWithRaj đã nhận 9 ngày trước. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Dokploy/dokploy#6075 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MongoDB with Replica Sets enabled: container exits with code 0 and restarts in a loop (generated startup script never waits on mongod)Có thể đã có người làm @ghazy2001 đã nhận 10 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6051 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Dokploy/dokploy
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ardia-browser/ardia#5042 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
clipy-recorder/clipy#695 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: RUN_STARTED resets the run's tool-call tally even when a subscriber suppresses the eventĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ag-ui-protocol/ag-ui#3504 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#161712 ·
Maintainer thường phản hồi trong vòng 1 ngày