The server log of a failing job shows every restart as 'untracked child process exited with exit code 2'. A health check that outlives its 3-second timeout leaves pg_isready to PostgreSQL, which is PID 1 in its container; when pg_isready exits the postmaster takes it for a crashed backend and restarts every connection. --init reaps such orphans, and pg_isready -t 5 under a 15-second timeout is never cut off. Same change in docker-compose.yml. ADR 0015. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
# Development only (SPEC 3): the app plus a local PostgreSQL. Never used in production.
|
|
# Start: docker compose up --build Health: curl http://localhost:8787/health
|
|
# First access at http://localhost:8787 with ANUBIS_ADMIN_PASSWORD, then choose a new password.
|
|
services:
|
|
anubis:
|
|
build:
|
|
context: .
|
|
dockerfile: deploy/docker/Dockerfile
|
|
image: gitea.encke-hake.ts.net/balbosoft/anubis:dev
|
|
# The guard gives the engine up to 55 seconds to close in order (SPEC 9.3).
|
|
stop_grace_period: 60s
|
|
ports:
|
|
- "8787:8787"
|
|
environment:
|
|
ANUBIS_DB_ENGINE: postgres
|
|
ANUBIS_DB_HOST: postgres
|
|
ANUBIS_DB_PORT: "5432"
|
|
ANUBIS_DB_NAME: anubis
|
|
ANUBIS_DB_USER: anubis
|
|
ANUBIS_DB_PASSWORD: ${ANUBIS_DB_PASSWORD:-anubis-dev}
|
|
# Development values only: a real installation chooses its own (deploy/unraid/anubis.xml).
|
|
ANUBIS_SECRET_KEY: ${ANUBIS_SECRET_KEY:-dev-only-secret-key-change-me-0123456789}
|
|
ANUBIS_ADMIN_PASSWORD: ${ANUBIS_ADMIN_PASSWORD:-dev-only-change-me}
|
|
ANUBIS_ALLOW_LIVE: "0"
|
|
TZ: Europe/Rome
|
|
volumes:
|
|
- anubis-data:/data
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
image: postgres:18
|
|
# An init as PID 1 and a pg_isready that gives up before Docker does (ADR 0015): otherwise a slow health check
|
|
# leaves pg_isready to PostgreSQL, and its exit makes the server restart every connection.
|
|
init: true
|
|
environment:
|
|
POSTGRES_DB: anubis
|
|
POSTGRES_USER: anubis
|
|
POSTGRES_PASSWORD: ${ANUBIS_DB_PASSWORD:-anubis-dev}
|
|
ports:
|
|
- "127.0.0.1:55432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U anubis -d anubis -t 5"]
|
|
interval: 3s
|
|
timeout: 15s
|
|
retries: 20
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql
|
|
|
|
volumes:
|
|
anubis-data:
|
|
postgres-data:
|