-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
96 lines (91 loc) · 2.36 KB
/
docker-compose.yaml
File metadata and controls
96 lines (91 loc) · 2.36 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
services:
postgres:
image: postgres:latest
container_name: postgres-worksheet
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
- ./config/postgresql/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./config/postgresql/scripts:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 15s
timeout: 10s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '2'
memory: 4G
restart: unless-stopped
networks:
- internal
pgbouncer:
image: bitnami/pgbouncer:latest
container_name: pgbouncer-worksheet
ports:
- '6432:6432'
environment:
POSTGRESQL_USERNAME: ${POSTGRES_USER}
POSTGRESQL_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRES_DB}
POSTGRESQL_HOST: ${POSTGRESQL_HOST}
POSTGRESQL_PORT: ${POSTGRESQL_PORT}
PGBOUNCER_DATABASE: ${POSTGRES_DB}
PGBOUNCER_AUTH_TYPE: "scram-sha-256"
PGBOUNCER_MAX_CLIENT_CONN: "100"
PGBOUNCER_MAX_DB_CONNECTIONS: "50"
PGBOUNCER_DEFAULT_POOL_SIZE: "20"
PGBOUNCER_MIN_POOL_SIZE: "10"
PGBOUNCER_RESERVE_POOL_SIZE: "10"
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
restart: unless-stopped
networks:
- internal
- external
depends_on:
postgres:
condition: service_healthy
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin-worksheet
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin-data:/var/lib/pgadmin
ports:
- "5050:80"
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
restart: unless-stopped
networks:
- external
depends_on:
postgres:
condition: service_healthy
volumes:
postgres-data:
driver: local
pgadmin-data:
driver: local
networks:
external:
driver: bridge
internal:
internal: true