-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
76 lines (71 loc) · 1.54 KB
/
docker-stack.yml
File metadata and controls
76 lines (71 loc) · 1.54 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
version: "3.4"
services:
wordpress:
image: wordpress:4-php7.1-fpm-alpine
ports:
- 9000:9000
volumes:
- wordpress:/var/www/html
secrets:
- wp_db_password
environment:
- WORDPRESS_DB_USER=wp
- WORDPRESS_DB_NAME=wp
- WORDPRESS_DB_PASSWORD_FILE=/run/secrets/wp_db_password
- WORDPRESS_DB_HOST=mariadb
networks:
- wordpress
- nginx
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
mariadb:
image: mariadb
volumes:
- mariadb_vol:/var/lib/mysql
secrets:
- wp_db_password
- root_db_password
environment:
- MYSQL_USER=wp
- MYSQL_DATABASE=wp
- MYSQL_PASSWORD_FILE=/run/secrets/wp_db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/root_db_password
networks:
- wordpress
deploy:
placement:
constraints: [node.role == manager]
replicas: 1
restart_policy:
condition: on-failure
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- wordpress:/var/www/html
secrets:
- source: nginx_config
target: /etc/nginx/conf.d/default.conf #have to call default or won't be loaded by nginx
networks:
- nginx
secrets:
wp_db_password:
external: true
root_db_password:
external: true
nginx_config:
external: true
volumes:
wordpress:
mariadb_vol:
networks:
wordpress:
nginx: