-
-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathcompose.yml
44 lines (42 loc) · 1023 Bytes
/
compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
services:
postgres:
image: postgres:latest
restart: unless-stopped
environment:
TZ: UTC
PGTZ: UTC
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "5432:5432"
volumes:
- openalternative-db-data:/var/lib/postgresql/data/
deploy:
resources:
limits:
memory: 1G
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
pgbouncer:
image: bitnami/pgbouncer:latest
restart: unless-stopped
environment:
POSTGRESQL_HOST: postgres
POSTGRESQL_PORT: 5432
POSTGRESQL_USERNAME: ${DB_USER}
POSTGRESQL_PASSWORD: ${DB_PASSWORD}
PGBOUNCER_DATABASE: ${DB_NAME}
PGBOUNCER_PORT: 6543
PGBOUNCER_BIND_ADDRESS: 0.0.0.0
ports:
- "6543:6543"
depends_on:
postgres:
condition: service_healthy
volumes:
openalternative-db-data:
driver: local