60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
# AngelaMos | 2026
|
|
# compose.yml - Production compose
|
|
|
|
services:
|
|
api:
|
|
image: go-backend:latest
|
|
ports:
|
|
- "8085:8080"
|
|
environment:
|
|
- ENVIRONMENT=production
|
|
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/app?sslmode=disable
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:8080/healthz"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
reservations:
|
|
memory: 128M
|
|
|
|
postgres:
|
|
image: postgres:18-alpine
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: app
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redisdata:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
pgdata:
|
|
redisdata:
|