Skip to content

Instantly share code, notes, and snippets.

@mr-linch
Last active August 17, 2022 12:40
Show Gist options
  • Save mr-linch/53d2701e576476328802449ffadfc133 to your computer and use it in GitHub Desktop.
Save mr-linch/53d2701e576476328802449ffadfc133 to your computer and use it in GitHub Desktop.
Docker Compose with Postgres 14 and PgBouncer for local development
version: '3.9'
volumes:
postgres-data:
driver: local
services:
postgres:
image: postgres:14-alpine
environment:
POSTGRES_USER: my-project
POSTGRES_PASSWORD: my-project
POSTGRES_DB: my-project
command: postgres -c log_statement=all
volumes:
- postgres-data:/var/lib/postgresql/data
pgbouncer:
image: edoburu/pgbouncer:1.17.0
ports:
- "5432:5432"
environment:
DATABASE_URL: postgres://my-project:my-project@postgres:5432/my-project
POOL_MODE: transaction
ADMIN_USERS: my-project
MAX_CLIENT_CONN: 1000
AUTH_TYPE: plain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment