fix(deploy): use expose instead of host ports for Coolify compose

Coolify honors host port bindings in the compose and the host already has :80
(its own proxy) and :8000 allocated, so publishing them fails the deploy at
container start. Switch web/api to expose-only; nginx still reaches api over the
compose network, and Coolify routes the domain via docker_compose_domains. Add a
docker-compose.override.yml so local 'docker compose up' still publishes ports.
This commit is contained in:
Julien Calixte
2026-06-26 15:36:14 +01:00
parent 528251f176
commit 645bd6ff27
4 changed files with 22 additions and 5 deletions

View File

@@ -5,3 +5,4 @@ dist
backend backend
data data
.zed .zed
docker-compose*.yml

View File

@@ -23,7 +23,7 @@ service (see `nginx.conf` + `docker-compose.yml`).
pnpm install pnpm install
pnpm dev # frontend on :5173 (proxies /api -> :8000) pnpm dev # frontend on :5173 (proxies /api -> :8000)
cd backend && pnpm install && pnpm dev # API on :8000 cd backend && pnpm install && pnpm dev # API on :8000
# …or run the whole stack in containers: # …or run the whole stack in containers (open http://localhost:8080):
docker compose up --build docker compose up --build
``` ```

View File

@@ -0,0 +1,11 @@
# Local-only host port bindings for `docker compose up`. Docker Compose
# auto-merges this file locally; Coolify runs with an explicit
# `-f docker-compose.yml`, so it ignores this override (no host-port conflicts
# on the Coolify host). Open http://localhost:8080 after `docker compose up`.
services:
web:
ports:
- "8080:80"
api:
ports:
- "8000:8000"

View File

@@ -1,8 +1,11 @@
services: services:
web: web:
build: . build: .
ports: # No host port binding: Coolify's proxy routes the domain to this service
- "80:80" # over the internal network (see docker_compose_domains). Host bindings
# would collide with Coolify's own :80 / other apps on the host.
expose:
- "80"
depends_on: depends_on:
- api - api
@@ -18,5 +21,7 @@ services:
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN:-} - SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN:-}
volumes: volumes:
- ./data:/app/data - ./data:/app/data
ports: # Internal only — the web (nginx) service reaches it at http://api:8000 on
- "8000:8000" # the compose network. Not published to the host.
expose:
- "8000"