-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
101 lines (95 loc) · 1.95 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: "3.7"
services:
wordpress:
image: wordpress:php7.4
volumes:
- /mnt/wp:/var/www/html/wp-content
networks:
- wpcnet
- wpcdb
secrets:
- wp_db_password
environment:
- WORDPRESS_DB_HOST=mariadb
- WORDPRESS_DB_USER=testuser
- WORDPRESS_DB_NAME=testdb
- WORDPRESS_DB_PASSWORD_FILE=/run/secrets/wp_db_password
deploy:
placement:
constraints:
- node.role == worker
mode: global
endpoint_mode: dnsrr
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
mariadb:
image: mariadb:10.5.8
volumes:
- /mnt/db:/var/lib/mysql
secrets:
- wp_db_password
environment:
- MYSQL_USER=testuser
- MYSQL_DATABASE=testdb
- MYSQL_PASSWORD_FILE=/run/secrets/wp_db_password
- MYSQL_RANDOM_ROOT_PASSWORD=yes
networks:
- wpcdb
deploy:
placement:
constraints:
- node.role == worker
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
haproxy:
image: haproxytech/haproxy-debian:2.3
volumes:
- ./conf/:/etc/haproxy/:ro
- ./certs:/usr/local/etc/certs:ro
networks:
- wpcnet
ports:
- "80:80"
- "443:443"
dns:
- "127.0.0.11"
deploy:
placement:
constraints:
- node.role == manager
mode: replicated
replicas: 1
restart_policy:
condition: any
nginx-certbot:
image: nginx
volumes:
- ./webroot:/usr/share/nginx/html
networks:
- wpcnet
deploy:
placement:
constraints:
- node.role == manager
mode: replicated
replicas: 1
restart_policy:
condition: any
secrets:
wp_db_password:
external: true
volumes:
db:
driver: "local"
wp:
driver: "local"
networks:
wpcnet:
external: false
wpcdb:
external: false