diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml new file mode 100644 index 0000000..786d89a --- /dev/null +++ b/docker-compose-prod.yml @@ -0,0 +1,48 @@ +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 + +volumes: + pgdata: + +networks: + dns: + name: dns + webproxy: + external: true \ No newline at end of file