name: protobase services: # The databases publish on 127.0.0.1 only: their superuser's password is the committed one in .env.example. postgres: image: postgres:18 ports: - '127.0.0.1:${POSTGRES_PORT}:5432' environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} # Bulk-load friendly settings for the seed script; not for production. command: > postgres -c shared_buffers=512MB -c maintenance_work_mem=512MB -c max_wal_size=8GB -c checkpoint_timeout=15min shm_size: 1gb volumes: - pgdata:/var/lib/postgresql healthcheck: test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] interval: 2s timeout: 3s retries: 30 # Supabase's Postgres image, initialised as a dedicated Protobase Cloud instance is (test-support/supabase-postgres/), # for the snapshot tests of the Supabase import that need Supabase's extensions; `bun run test:record` records on it. supabase-postgres: image: ghcr.io/supabase/postgres:17.11.0.006 ports: - '127.0.0.1:${SUPABASE_POSTGRES_PORT:-55433}:5432' environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - ./test-support/supabase-postgres:/docker-entrypoint-initdb.d:ro - supabase-pgdata:/var/lib/postgresql/data healthcheck: test: ['CMD-SHELL', 'pg_isready -U supabase_admin -d postgres -h 127.0.0.1'] interval: 2s timeout: 3s retries: 60 # The cloud's pooler in front of the same server, with its settings (protobase-cloud pooler/pgbouncer.ini): transaction # pooling, prepared statements and statement_timeout tracked, three server connections per role. The jobs and long # query integration tests run through it. The image writes pgbouncer.ini from the variables below; the command adds # track_extra_parameters, which it has no variable for. pgbouncer: image: edoburu/pgbouncer:v1.26.0-p0 command: - sh - -c - sed -i '/^track_extra_parameters/d; /^\[pgbouncer\]/a track_extra_parameters = statement_timeout' /etc/pgbouncer/pgbouncer.ini && exec pgbouncer /etc/pgbouncer/pgbouncer.ini ports: - '127.0.0.1:${PGBOUNCER_PORT:-55442}:5432' environment: DB_HOST: postgres DB_USER: ${POSTGRES_USER} DB_PASSWORD: ${POSTGRES_PASSWORD} AUTH_TYPE: scram-sha-256 POOL_MODE: transaction MAX_PREPARED_STATEMENTS: 200 MAX_USER_CONNECTIONS: 3 # The tests pause and resume a database on its admin console, as the platform scales one to zero. ADMIN_USERS: ${POSTGRES_USER} depends_on: postgres: condition: service_healthy # A LiveKit server for the calls bridge's contract test (`bun run calls:up`, then `bun run test:calls`), with the # signal and media ports on the host: only started with the calls profile. LIVEKIT_IMAGE tries another version. livekit: image: ${LIVEKIT_IMAGE:-livekit/livekit-server:v1.13.11} profiles: [calls] command: --config /livekit.yaml ports: - '7880:7880' - '7881:7881' - '7882:7882/udp' volumes: - ./docker/livekit/livekit.yaml:/livekit.yaml:ro volumes: pgdata: supabase-pgdata: