services:
  postgres:
    image: postgres:16
    ports:
      - "${PGPORT:?err}:${PGPORT}"
    environment:
      POSTGRES_PASSWORD: postgres
      PGDATA: /tmp/postgresql
      POSTGRES_INITDB_ARGS: "-c port=$PGPORT -c max_connections=2000 -c synchronous_commit=off -c wal_level=logical"
    healthcheck:
      test: "PGPORT=$PGPORT pg_isready -U postgres"
      interval: 0.3s
      timeout: 20s
      retries: 10
