version: '3.8' services: postgres: image: postgres:16-alpine container_name: postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: flower ports: - "5432:5432" volumes: - db_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 3s retries: 5 start_period: 10s restart: unless-stopped pgbouncer: image: pgbouncer/pgbouncer:latest container_name: pgbouncer environment: POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_DB: flower POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres DATABASES_HOST: postgres DATABASES_PORT: "5432" DATABASES_USER: postgres DATABASES_PASSWORD: postgres DATABASES_DBNAME: flower PGBOUNCER_POOL_MODE: transaction PGBOUNCER_MAX_CLIENT_CONN: "100" PGBOUNCER_DEFAULT_POOL_SIZE: "25" PGBOUNCER_MIN_POOL_SIZE: "5" PGBOUNCER_RESERVE_POOL_SIZE: "5" PGBOUNCER_RESERVE_POOL_TIMEOUT: "3" PGBOUNCER_SERVER_IDLE_TIMEOUT: "600" PGBOUNCER_LOG_CONNECTIONS: "1" PGBOUNCER_LOG_DISCONNECTIONS: "1" PGBOUNCER_LOG_POOLER_ERRORS: "1" ports: - "6432:6432" healthcheck: test: ["CMD-SHELL", "timeout 1 bash -c '