chore(docker): publish ports only in development

docker-compose.yml is the production definition (deployed by Dokploy) and no
longer publishes any port: postgres, mongo, redis and the API are reachable
only on the compose network, and the web goes out through the platform's
proxy (domain → service web, port 80). The ports moved to
docker-compose.override.yml, which Compose loads automatically locally and
Dokploy (-f docker-compose.yml) does not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 14:16:50 +02:00
parent bf0294a188
commit b2c9be72c3
5 changed files with 38 additions and 13 deletions

View File

@@ -1,4 +1,8 @@
# TaskStream: web + API + infrastructure.
# TaskStream: web + API + infrastructure — production definition (Dokploy deploys this file).
# No ports are published here: services only talk over the compose network, and the web is
# exposed through the platform's proxy (Dokploy domain → service `web`, port 80).
#
# Locally, `docker compose` also loads docker-compose.override.yml, which publishes the ports:
# docker compose up -d --build → everything: web on http://localhost:8080
# docker compose up -d postgres mongo redis → only infrastructure (then `npx nx serve api` / `npx nx serve web`)
#
@@ -11,7 +15,7 @@ services:
target: web
secrets: [nexus_token]
image: task-stream-web
ports: ['8080:80']
expose: ['80']
depends_on:
api: { condition: service_healthy }
restart: unless-stopped
@@ -22,7 +26,7 @@ services:
target: api
secrets: [nexus_token]
image: task-stream-api
ports: ['3000:3000']
expose: ['3000']
environment:
POSTGRES_URL: postgres://taskstream:taskstream@postgres:5432/taskstream
# No migrations yet: TypeORM creates the event store and lookup tables.
@@ -50,7 +54,6 @@ services:
POSTGRES_USER: taskstream
POSTGRES_PASSWORD: taskstream
POSTGRES_DB: taskstream
ports: ['5432:5432']
volumes: [postgres-data:/var/lib/postgresql/data]
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U taskstream']
@@ -59,7 +62,6 @@ services:
mongo:
image: mongo:8
ports: ['27017:27017']
volumes: [mongo-data:/data/db]
healthcheck:
test: ['CMD', 'mongosh', '--quiet', '--eval', 'db.adminCommand("ping")']
@@ -69,7 +71,6 @@ services:
redis:
image: redis:7-alpine
command: ['redis-server', '--appendonly', 'yes']
ports: ['6379:6379']
volumes: [redis-data:/data]
healthcheck:
test: ['CMD', 'redis-cli', 'ping']