89 lines
2.1 KiB
YAML
89 lines
2.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: docker.io/library/postgres:15-alpine
|
|
container_name: kms-postgres
|
|
environment:
|
|
POSTGRES_DB: kms
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d:Z
|
|
networks:
|
|
- kms-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d kms"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
nginx:
|
|
image: docker.io/library/nginx:alpine
|
|
container_name: kms-nginx
|
|
ports:
|
|
- "8081:80"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
- api-service
|
|
networks:
|
|
- kms-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
api-service:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: kms-api-service
|
|
environment:
|
|
APP_ENV: development
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: kms
|
|
DB_USER: postgres
|
|
DB_PASSWORD: postgres
|
|
DB_SSLMODE: disable
|
|
SERVER_HOST: 0.0.0.0
|
|
SERVER_PORT: 8080
|
|
LOG_LEVEL: debug
|
|
MIGRATION_PATH: /app/migrations
|
|
INTERNAL_HMAC_KEY: bootstrap-hmac-key-change-in-production
|
|
AUTH_PROVIDER: header
|
|
AUTH_HEADER_USER_EMAIL: X-User-Email
|
|
RATE_LIMIT_ENABLED: true
|
|
CACHE_ENABLED: false
|
|
METRICS_ENABLED: true
|
|
ports:
|
|
- "8080:8080"
|
|
- "9090:9090" # Metrics port
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- kms-network
|
|
volumes:
|
|
- ./migrations:/app/migrations:ro,Z
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
|
|
networks:
|
|
kms-network:
|
|
driver: bridge
|