From 9c29df415cbba65d8b3b08220cc4cb43ad3fcb83 Mon Sep 17 00:00:00 2001 From: LeoGomide Date: Thu, 28 May 2026 12:22:37 -0300 Subject: [PATCH] fix(plane): rename services + add proxy links to avoid DNS collision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plane-proxy image has hardcoded `reverse_proxy web:3000`/`api:8000` in its Caddyfile with generic service names. In multi-stack Dokploy deployments, those names collide with other stacks' containers (Next.js apps frequently have a `web` service) on the shared dokploy-network — the Plane domain ends up serving content from unrelated stacks. Two-step fix: 1. Rename internal services with `plane-*` prefix (unique cluster-wide): web/space/admin/live/api/worker/beat-worker/migrator → plane-* 2. Add `links:` block to the `proxy` service mapping the new names back to the generic ones the Caddyfile expects (`plane-web:web` etc.). Docker injects these into /etc/hosts, which has absolute priority over DNS — Caddy resolves `web`/`api`/etc. directly to our renamed containers, ignoring any collision on dokploy-network. Also updates `API_BASE_URL` in template.toml and the `x-live-env` anchor from `http://api:8000` → `http://plane-api:8000`. No `networks:` declarations added (repo validator rejects them; Dokploy manages networking automatically). --- blueprints/plane/docker-compose.yml | 66 +++++++++++++++++------------ blueprints/plane/template.toml | 2 +- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/blueprints/plane/docker-compose.yml b/blueprints/plane/docker-compose.yml index f424490a..72e04945 100644 --- a/blueprints/plane/docker-compose.yml +++ b/blueprints/plane/docker-compose.yml @@ -1,5 +1,13 @@ version: "3.8" +# Anti-colisão de DNS em multi-stack Dokploy: +# Services internos renomeados com prefix `plane-*` (únicos cluster-wide) e +# `links:` no service `proxy` cria entries em /etc/hosts (` +# web`, etc.) — /etc/hosts tem prioridade absoluta sobre DNS, então o Caddy +# interno do plane-proxy (que tem `reverse_proxy web:3000`/`api:8000` +# hardcoded) resolve direto pros nossos containers, ignorando containers +# `web`/`api` de outros stacks na dokploy-network compartilhada. + x-db-env: &db-env PGHOST: ${PGHOST:-plane-db} PGDATABASE: ${PGDATABASE:-plane} @@ -39,7 +47,7 @@ x-mq-env: &mq-env RABBITMQ_VHOST: ${RABBITMQ_VHOST:-plane} x-live-env: &live-env - API_BASE_URL: ${API_BASE_URL:-http://api:8000} + API_BASE_URL: ${API_BASE_URL:-http://plane-api:8000} LIVE_SERVER_SECRET_KEY: ${LIVE_SERVER_SECRET_KEY:-dev-only-change-me} x-app-env: &app-env @@ -58,47 +66,47 @@ x-app-env: &app-env WEBHOOK_ALLOWED_HOSTS: ${WEBHOOK_ALLOWED_HOSTS:-} services: - web: + plane-web: image: makeplane/plane-frontend:${APP_RELEASE:-v1.3.1} restart: unless-stopped depends_on: - api: + plane-api: condition: service_started - worker: + plane-worker: condition: service_started - space: + plane-space: image: makeplane/plane-space:${APP_RELEASE:-v1.3.1} restart: unless-stopped depends_on: - api: + plane-api: condition: service_started - worker: + plane-worker: condition: service_started - web: + plane-web: condition: service_started - admin: + plane-admin: image: makeplane/plane-admin:${APP_RELEASE:-v1.3.1} restart: unless-stopped depends_on: - api: + plane-api: condition: service_started - web: + plane-web: condition: service_started - live: + plane-live: image: makeplane/plane-live:${APP_RELEASE:-v1.3.1} restart: unless-stopped environment: <<: [*live-env, *redis-env] depends_on: - api: + plane-api: condition: service_started - web: + plane-web: condition: service_started - api: + plane-api: image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1} restart: unless-stopped command: ./bin/docker-entrypoint-api.sh @@ -113,10 +121,10 @@ services: condition: service_healthy plane-mq: condition: service_healthy - migrator: + plane-migrator: condition: service_completed_successfully - worker: + plane-worker: image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1} restart: unless-stopped command: ./bin/docker-entrypoint-worker.sh @@ -131,10 +139,10 @@ services: condition: service_healthy plane-mq: condition: service_healthy - migrator: + plane-migrator: condition: service_completed_successfully - beat-worker: + plane-beat-worker: image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1} restart: unless-stopped command: ./bin/docker-entrypoint-beat.sh @@ -149,10 +157,10 @@ services: condition: service_healthy plane-mq: condition: service_healthy - migrator: + plane-migrator: condition: service_completed_successfully - migrator: + plane-migrator: image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1} restart: on-failure command: ./bin/docker-entrypoint-migrator.sh @@ -226,16 +234,22 @@ services: volumes: - proxy_config:/config - proxy_data:/data + links: + - "plane-web:web" + - "plane-api:api" + - "plane-space:space" + - "plane-admin:admin" + - "plane-live:live" depends_on: - web: + plane-web: condition: service_started - api: + plane-api: condition: service_started - space: + plane-space: condition: service_started - admin: + plane-admin: condition: service_started - live: + plane-live: condition: service_started volumes: diff --git a/blueprints/plane/template.toml b/blueprints/plane/template.toml index 442bab07..902a382e 100644 --- a/blueprints/plane/template.toml +++ b/blueprints/plane/template.toml @@ -18,7 +18,7 @@ env = [ "APP_DOMAIN=${main_domain}", "WEB_URL=https://${main_domain}", "CORS_ALLOWED_ORIGINS=https://${main_domain}", - "API_BASE_URL=http://api:8000", + "API_BASE_URL=http://plane-api:8000", "SECRET_KEY=${secret_key}", "LIVE_SERVER_SECRET_KEY=${live_secret_key}", "POSTGRES_USER=plane",