-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-stack.yml
42 lines (39 loc) · 898 Bytes
/
docker-stack.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
version: '3'
services:
db:
image: mysql
deploy:
replicas: 1
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: root
MYSQL_DATABASE: FirstCRUDApp
# healthcheck:
# test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
# start_period: 5s
# interval: 5s
# timeout: 5s
# retries: 55
volumes:
- ./init_data:/docker-entrypoint-initdb.d
custom_app:
image: thespiritman/firstcrudapplication
deploy:
replicas: 4
placement:
constraints: [node.role == worker]
restart_policy:
condition: on-failure
depends_on:
- db
# condition: service_healthy
ports:
- 5555:5555
volumes:
init_data: