49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-dnsar}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set in .env}
|
|
POSTGRES_DB: ${POSTGRES_DB:-dnsar}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dnsar} -d ${POSTGRES_DB:-dnsar}"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
networks:
|
|
dns:
|
|
|
|
app:
|
|
build: .
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DNS_AR_DB_DSN: postgres://${POSTGRES_USER:-dnsar}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-dnsar}?sslmode=disable
|
|
DNS_AR_ENC_KEY: ${DNS_AR_ENC_KEY:?base64 32 bytes, see .env.example}
|
|
DNS_AR_LISTEN: ":8080"
|
|
expose:
|
|
- "${APP_PORT:-8080}"
|
|
healthcheck:
|
|
test: ["CMD", "/app", "-healthcheck"]
|
|
interval: 10s
|
|
timeout: 4s
|
|
retries: 5
|
|
start_period: 15s
|
|
restart: unless-stopped
|
|
networks:
|
|
dns:
|
|
webproxy:
|
|
ipv4_address: 172.18.0.23
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
dns:
|
|
name: dns
|
|
webproxy:
|
|
external: true |