88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: fischerx-postgres
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER:-fischerx}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-fischerx}
|
|
POSTGRES_DB: ${DB_NAME:-fischerx}
|
|
ports:
|
|
- "${DB_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./infra/db/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
networks:
|
|
- fischerx-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-fischerx}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: fischerx-redis
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- fischerx-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build:
|
|
context: ./services/api
|
|
dockerfile: Dockerfile
|
|
container_name: fischerx-api
|
|
ports:
|
|
- "${API_PORT:-3001}:3001"
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
PORT: ${API_PORT:-3001}
|
|
DATABASE_URL: postgresql://${DB_USER:-fischerx}:${DB_PASSWORD:-fischerx}@postgres:5432/${DB_NAME:-fischerx}?schema=public
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key-change-in-production}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- fischerx-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
web:
|
|
build:
|
|
context: ./apps/web
|
|
dockerfile: Dockerfile
|
|
container_name: fischerx-web
|
|
ports:
|
|
- "${WEB_PORT:-3000}:3000"
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001}
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
networks:
|
|
- fischerx-network
|
|
|
|
volumes:
|
|
postgres-data:
|
|
redis-data:
|
|
|
|
networks:
|
|
fischerx-network:
|
|
driver: bridge
|