Skip to content

Commit 3ce23ad

Browse files
authored
Create stack.yml
1 parent 3448e39 commit 3ce23ad

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

intermediate/swarm/rexray/stack.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: '3.1'
2+
3+
services:
4+
db:
5+
image: mysql:5.7
6+
volumes:
7+
- storage1:/var/lib/mysql
8+
restart: always
9+
environment:
10+
MYSQL_ROOT_PASSWORD: wordpress
11+
MYSQL_DATABASE: wordpress
12+
MYSQL_USER: wordpress
13+
MYSQL_PASSWORD: wordpress
14+
deploy:
15+
placement:
16+
constraints: [node.role == worker]
17+
replicas: 1
18+
update_config:
19+
parallelism: 2
20+
delay: 10s
21+
restart_policy:
22+
condition: on-failure
23+
24+
wordpress:
25+
depends_on:
26+
- db
27+
image: wordpress:latest
28+
ports:
29+
- "8000:80"
30+
restart: always
31+
environment:
32+
WORDPRESS_DB_HOST: db:3306
33+
WORDPRESS_DB_PASSWORD: wordpress
34+
deploy:
35+
placement:
36+
constraints: [node.role == worker]
37+
replicas: 1
38+
update_config:
39+
parallelism: 2
40+
delay: 10s
41+
restart_policy:
42+
condition: on-failure
43+
44+
volumes:
45+
storage1:
46+
external: true

0 commit comments

Comments
 (0)