-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (47 loc) · 1020 Bytes
/
docker-compose.yml
File metadata and controls
60 lines (47 loc) · 1020 Bytes
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
version: "3.8"
services:
mysql:
container_name: mysql
image: mysql
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "devops"
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- two-tier-nt
restart: always
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot","-proot"]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
flask-app:
container_name: two-tier-app
build:
context: .
ports:
- "5000:5000"
environment:
- MYSQL_HOST=mysql
- MYSQL_USER=root
- MYSQL_PASSWORD=root
- MYSQL_DB=devops
networks:
- two-tier-nt
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
volumes:
mysql_data:
networks:
two-tier-nt: