-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (39 loc) · 903 Bytes
/
docker-compose.yml
File metadata and controls
42 lines (39 loc) · 903 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
version: '3.8'
services:
flask:
build: ./backend
container_name: flask_app
ports:
- "5000:5000"
environment:
- FLASK_APP=app.py
- FLASK_ENV=production
- MYSQL_HOST=mysql
- MYSQL_USER=root
- MYSQL_PASSWORD=rootpass
- MYSQL_DATABASE=devops_exam
depends_on:
mysql:
condition: service_healthy
volumes:
- ./backend:/app
- ./frontend:/app/templates
mysql:
image: mysql:5.7
container_name: mysql_db
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: devops_exam
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-uroot", "-prootpass"]
interval: 5s
timeout: 10s
retries: 10
volumes:
mysql_data:
driver: local