-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (40 loc) · 991 Bytes
/
docker-compose.yml
File metadata and controls
44 lines (40 loc) · 991 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
version: '3.1'
services:
mysql:
image: mysql:latest
container_name: model_logger_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: Model_Logger
MYSQL_USER: user
MYSQL_PASSWORD: user_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql # Persist MySQL data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql # Initialize MySQL database
networks:
- app-network
flask-app:
build:
context: ./app
container_name: flask_app
depends_on:
- mysql
environment:
- MYSQL_HOST=model_logger_db
- MYSQL_USER=user
- MYSQL_PASSWORD=user_password
- MYSQL_DB=Model_Logger
ports:
- "5000:5000"
volumes:
- ./app:/app # Map app folder to allow live changes
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
mysql_data: # Define named volume for MySQL data persistence