Files
templates/blueprints/plane/docker-compose.yml
LeoGomide 9c29df415c fix(plane): rename services + add proxy links to avoid DNS collision
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).
2026-05-28 12:22:37 -03:00

266 lines
7.6 KiB
YAML

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 (`<IP-do-plane-web>
# 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}
POSTGRES_USER: ${POSTGRES_USER:-plane}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-plane}
POSTGRES_DB: ${POSTGRES_DB:-plane}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
PGDATA: ${PGDATA:-/var/lib/postgresql/data}
x-redis-env: &redis-env
REDIS_HOST: ${REDIS_HOST:-plane-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_URL: ${REDIS_URL:-redis://plane-redis:6379/}
x-minio-env: &minio-env
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID:-access-key}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY:-secret-key}
x-aws-s3-env: &aws-s3-env
AWS_REGION: ${AWS_REGION:-}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-access-key}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-secret-key}
AWS_S3_ENDPOINT_URL: ${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000}
AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME:-uploads}
x-proxy-env: &proxy-env
APP_DOMAIN: ${APP_DOMAIN:-localhost}
FILE_SIZE_LIMIT: ${FILE_SIZE_LIMIT:-5242880}
BUCKET_NAME: ${AWS_S3_BUCKET_NAME:-uploads}
x-mq-env: &mq-env
RABBITMQ_HOST: ${RABBITMQ_HOST:-plane-mq}
RABBITMQ_PORT: ${RABBITMQ_PORT:-5672}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-plane}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-plane}
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_VHOST:-plane}
RABBITMQ_VHOST: ${RABBITMQ_VHOST:-plane}
x-live-env: &live-env
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
WEB_URL: ${WEB_URL:-http://localhost}
DEBUG: ${DEBUG:-0}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost}
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-1}
USE_MINIO: ${USE_MINIO:-1}
DATABASE_URL: ${DATABASE_URL:-postgresql://plane:plane@plane-db/plane}
SECRET_KEY: ${SECRET_KEY:-dev-only-change-me}
AMQP_URL: ${AMQP_URL:-amqp://plane:plane@plane-mq:5672/plane}
API_KEY_RATE_LIMIT: ${API_KEY_RATE_LIMIT:-60/minute}
MINIO_ENDPOINT_SSL: ${MINIO_ENDPOINT_SSL:-0}
LIVE_SERVER_SECRET_KEY: ${LIVE_SERVER_SECRET_KEY:-dev-only-change-me}
WEBHOOK_ALLOWED_IPS: ${WEBHOOK_ALLOWED_IPS:-}
WEBHOOK_ALLOWED_HOSTS: ${WEBHOOK_ALLOWED_HOSTS:-}
services:
plane-web:
image: makeplane/plane-frontend:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
depends_on:
plane-api:
condition: service_started
plane-worker:
condition: service_started
plane-space:
image: makeplane/plane-space:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
depends_on:
plane-api:
condition: service_started
plane-worker:
condition: service_started
plane-web:
condition: service_started
plane-admin:
image: makeplane/plane-admin:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
depends_on:
plane-api:
condition: service_started
plane-web:
condition: service_started
plane-live:
image: makeplane/plane-live:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
environment:
<<: [*live-env, *redis-env]
depends_on:
plane-api:
condition: service_started
plane-web:
condition: service_started
plane-api:
image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
command: ./bin/docker-entrypoint-api.sh
volumes:
- logs_api:/code/plane/logs
environment:
<<: [*app-env, *db-env, *redis-env, *minio-env, *aws-s3-env, *proxy-env]
depends_on:
plane-db:
condition: service_healthy
plane-redis:
condition: service_healthy
plane-mq:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-worker:
image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
command: ./bin/docker-entrypoint-worker.sh
volumes:
- logs_worker:/code/plane/logs
environment:
<<: [*app-env, *db-env, *redis-env, *minio-env, *aws-s3-env, *proxy-env]
depends_on:
plane-db:
condition: service_healthy
plane-redis:
condition: service_healthy
plane-mq:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-beat-worker:
image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
command: ./bin/docker-entrypoint-beat.sh
volumes:
- logs_beat-worker:/code/plane/logs
environment:
<<: [*app-env, *db-env, *redis-env, *minio-env, *aws-s3-env, *proxy-env]
depends_on:
plane-db:
condition: service_healthy
plane-redis:
condition: service_healthy
plane-mq:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-migrator:
image: makeplane/plane-backend:${APP_RELEASE:-v1.3.1}
restart: on-failure
command: ./bin/docker-entrypoint-migrator.sh
volumes:
- logs_migrator:/code/plane/logs
environment:
<<: [*app-env, *db-env, *redis-env, *minio-env, *aws-s3-env, *proxy-env]
depends_on:
plane-db:
condition: service_healthy
plane-redis:
condition: service_healthy
plane-db:
image: postgres:17-alpine
restart: unless-stopped
command: postgres -c 'max_connections=1000'
environment:
<<: *db-env
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-plane} -d ${POSTGRES_DB:-plane}"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
plane-redis:
image: valkey/valkey:7.2.11-alpine
restart: unless-stopped
volumes:
- redisdata:/data
healthcheck:
test: ["CMD-SHELL", "valkey-cli ping | grep -q PONG"]
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
plane-mq:
image: rabbitmq:3.13.6-management-alpine
restart: unless-stopped
environment:
<<: *mq-env
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 10s
retries: 10
start_period: 30s
plane-minio:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
restart: unless-stopped
command: server /export --console-address ":9090"
environment:
<<: *minio-env
volumes:
- uploads:/export
proxy:
image: makeplane/plane-proxy:${APP_RELEASE:-v1.3.1}
restart: unless-stopped
expose:
- "80"
environment:
<<: *proxy-env
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:
plane-web:
condition: service_started
plane-api:
condition: service_started
plane-space:
condition: service_started
plane-admin:
condition: service_started
plane-live:
condition: service_started
volumes:
pgdata:
redisdata:
uploads:
rabbitmq_data:
logs_api:
logs_worker:
logs_beat-worker:
logs_migrator:
proxy_config:
proxy_data: