# SignalHaven example docker compose stack. # # Copy `.env.example` to `.env` (and edit the credentials) before running: # # docker compose up -d # # The `signalhaven` service waits for `postgres` to become healthy before starting # and then connects to it via SIGNALHAVEN_DATABASE_URL. To point SignalHaven at an # external Postgres instead, remove the `postgres` service and `depends_on` # block below and set SIGNALHAVEN_DATABASE_URL in your `.env` to the external # connection string. services: signalhaven: image: ${SIGNALHAVEN_IMAGE:-ghcr.io/rrainn/signalhaven:latest} # Uncomment to build the image locally instead of pulling a published one: # build: # context: . container_name: signalhaven # NVIDIA hosts can enable NVENC by uncommenting this device reservation # and the NVIDIA environment variables below. # gpus: all restart: unless-stopped environment: SIGNALHAVEN_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} SIGNALHAVEN_EXTERNAL_IP_LOOKUP_ENABLED: ${SIGNALHAVEN_EXTERNAL_IP_LOOKUP_ENABLED:-false} # NVIDIA_VISIBLE_DEVICES: all # NVIDIA_DRIVER_CAPABILITIES: video,compute,utility ports: - "${SIGNALHAVEN_HTTP_PORT:-3000}:3000" volumes: - signalhaven-recordings:/var/lib/signalhaven/recordings depends_on: postgres: condition: service_healthy healthcheck: test: [ "CMD", "node", "-e", "fetch('http://127.0.0.1:3001/api/v1/health').then(r=>{if(r.status!==200)process.exit(1)}).catch(()=>process.exit(1))" ] interval: 30s timeout: 5s retries: 5 start_period: 20s postgres: image: postgres:16-alpine container_name: signalhaven-postgres restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ports: - "5432:5432" volumes: - signalhaven-pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 10 volumes: signalhaven-pgdata: signalhaven-recordings: