docker-compose.yml
Rama master · réplica de lectura del repositorio original.
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: fynt
POSTGRES_PASSWORD: fynt
POSTGRES_DB: fynt
ports:
- "${FYNT_POSTGRES_PORT:-55432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fynt -d fynt"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
bootstrap:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command:
- /bin/sh
- -lc
- (pnpm exec prisma --config prisma.config.ts migrate deploy || pnpm exec prisma --config prisma.config.ts db push) && pnpm db:seed
depends_on:
postgres:
condition: service_healthy
restart: "no"
realtime:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command: ["pnpm", "--filter", "@fynt/realtime", "start"]
depends_on:
bootstrap:
condition: service_completed_successfully
redis:
condition: service_healthy
ports:
- "3101:3101"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:3101/health').then((res)=>process.exit(res.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
worker:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command: ["pnpm", "--filter", "@fynt/worker", "start"]
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
web:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command:
- /bin/sh
- -lc
- pnpm --filter @fynt/web build && pnpm --filter @fynt/web start
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
realtime:
condition: service_healthy
ports:
- "3000:3000"
restart: unless-stopped
volumes:
postgres_data:
redis_data: