-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
79 lines (76 loc) · 2.01 KB
/
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
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
services:
postgres:
container_name: postgres
image: postgres:${POSTGRES_VERSION_TAG:-alpine}
env_file: .env
restart: always
deploy:
resources:
limits:
cpus: $POSTGRES_LIMITS_CPUS
memory: $POSTGRES_LIMITS_MEMORY
reservations:
cpus: $POSTGRES_RESERVATIONS_CPUS
memory: $POSTGRES_RESERVATIONS_MEMORY
networks:
- pg
ports:
- 54301:54321
volumes:
- var-lib-postgresql-data:/var/lib/postgresql/data/
# - ./bind/var-lib-postgresql:/var/lib/postgresql/data/
- ./bind/etc-pgdump:/etc/pgdump/
- ./pg_hba.conf:/etc/postgresql/pg_hba.conf
- ./postgresql.conf:/etc/postgresql/postgresql.conf
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
command: postgres -c config_file=/etc/postgresql/postgresql.conf
healthcheck:
test:
[
'CMD-SHELL',
'pg_isready -d $POSTGRES_DB -U $POSTGRES_USER --port 54321',
]
interval: 10s
timeout: 5s
retries: 5
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
profiles: ['pgadmin']
depends_on:
postgres:
condition: service_healthy
env_file: .env
deploy:
resources:
limits:
cpus: $PGADMIN_LIMITS_CPUS
memory: $PGADMIN_LIMITS_MEMORY
restart_policy:
condition: $PGADMIN_RESTART_CONDITION
delay: $PGADMIN_RESTART_DELAY
max_attempts: 5
window: '1h'
networks:
- nginx
- pg
ports:
- 5050:80
- 5051:443
volumes:
- var-lib-pgadmin:/var/lib/pgadmin
# - ./bind/var-lib-pgadmin:/var/lib/pgadmin
# - ./bind/pgadmin4:/pgadmin4
# - ./bind/pgadmin4/servers.json:/pgadmin4/servers.json
# - ./path/to/certificate.cert:/certs/server.cert
# - ./path/to/certificate.key:/certs/server.key
networks:
pg:
external: true
nginx:
external: true
volumes:
var-lib-postgresql-data:
external: true
var-lib-pgadmin:
external: true