-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose-basic-services.yml
More file actions
81 lines (78 loc) · 1.81 KB
/
docker-compose-basic-services.yml
File metadata and controls
81 lines (78 loc) · 1.81 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
version: "3.9"
secrets:
postgres_user:
external: true
name: ${PROJECT_NAME}_postgres_user
postgres_password:
external: true
name: ${PROJECT_NAME}_postgres_password
configs:
postgres_db_setup.sql:
external: true
name: ${PROJECT_NAME}_postgres_db_setup.sql
volumes:
postgres:
nginx_dhparam:
nginx_ssl:
networks:
postgres:
attachable: true
name: postgres
frontend:
attachable: true
name: frontend
services:
gateway:
image: mesudip/nginx-proxy
networks:
- frontend
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nginx_dhparam:/etc/nginx/dhparam
- nginx_ssl:/etc/ssl
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
deploy:
placement:
constraints:
- node.labels.gateway == true
restart_policy:
delay: "10s"
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_LOGGING=true
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
- POSTGRES_USER_FILE=/run/secrets/postgres_user
secrets:
- postgres_password
- postgres_user
configs:
- source: postgres_db_setup.sql
target: /docker-entrypoint-initdb.d/postgres_db_setup.sql
networks:
- postgres
volumes:
- postgres:/var/lib/postgresql/data
ports:
- 5432:5432
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
command: ${POSTGRES_ARGS:--c maintenance_work_mem=1GB -c max_parallel_maintenance_workers=4}
deploy:
placement:
constraints:
- node.labels.blockchain == true
restart_policy:
delay: "30s"