From 19f9317e6e199f0aeaaf5e11ccd3ff679516425d Mon Sep 17 00:00:00 2001 From: loa212 Date: Thu, 30 Jul 2026 10:25:57 +0200 Subject: [PATCH] Declare the port a reverse proxy should send traffic to Coolify generates Traefik routers from the compose file, but it reads `expose` to learn the backend port. With only a published `ports` mapping it emitted routers with no `loadbalancer.server.port`, so Traefik matched the host and then had nowhere to send the request: a 502 in front of a container that was running and healthy. `expose` is redundant for a plain `docker compose up`, where the published port already reaches the container. It is kept alongside `ports` rather than replacing it so `localhost:3000` keeps working, as the README documents. Also drops a comment on container_name that named the wrong cause. Coolify overrides that key with its own generated name, so it was never the reason the proxy could not reach the container. --- docker-compose.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dc1d634..bbd5a7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,17 @@ services: # This compose file is the installation path: use the image built by the # release workflow instead of recompiling the Rust workspace on the host. pull_policy: always - # No container_name on purpose: a reverse proxy that names its own - # containers — Coolify does, appending a per-deployment suffix — routes to - # the name Compose generates. Pinning it here makes that backend - # unresolvable and the proxy answers 502. + # No container_name: nothing here refers to the container by name, and a + # platform that manages its own naming overrides the key regardless. restart: unless-stopped ports: - "3000:3000" + # Redundant next to the published port for a plain `docker compose up`, but + # a platform that puts its own reverse proxy in front reads `expose` to + # learn which port to send traffic to — Coolify does, and without it the + # proxy has a route with no backend port and answers 502. + expose: + - "3000" environment: # The key for the secret store. Generate once with # `openssl rand -hex 32` and keep it: losing it makes every stored