80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Next.js Application
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: lumina-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3000
|
|
- NEXT_TELEMETRY_DISABLED=1
|
|
env_file:
|
|
- .env.local
|
|
networks:
|
|
- lumina-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.app.rule=Host(`localhost`)"
|
|
- "traefik.http.services.app.loadbalancer.server.port=3000"
|
|
|
|
# PostgreSQL Database (Optional - for local development)
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: lumina-postgres
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_USER=lumina
|
|
- POSTGRES_PASSWORD=lumina_dev_password
|
|
- POSTGRES_DB=lumina_db
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
networks:
|
|
- lumina-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U lumina"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis Cache (Optional - for session management)
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: lumina-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- lumina-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
networks:
|
|
lumina-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
postgres-data:
|
|
driver: local
|
|
redis-data:
|
|
driver: local
|