-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (50 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
53 lines (50 loc) · 1.33 KB
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
version: '3'
services:
backend:
build:
context: ./api
dockerfile: Dockerfile.backend
ports:
- "5000:5000"
volumes:
- ./api:/usr/src/app/api
- ~/.cache/huggingface:/root/.cache/huggingface
- ./vector_store:/app/vector_store
environment:
FLASK_ENV: development
DB_HOST: mysql
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: password
DB_NAME: fairness_db
command: ["flask", "run", "--host=0.0.0.0", "--port=5000"]
depends_on:
- mysql
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.frontend
ports:
- "5173:5173"
volumes:
- ./frontend:/usr/src/app/frontend
- /usr/src/app/frontend/node_modules
environment:
- VITE_BACKEND_URL=http://backend:5000
depends_on:
- backend
command: ["npm", "run", "dev"]
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: fairness_db
ports:
- "3307:3306" #Expose MySQL port (Swapped to 3307 to make unique connection, 3306 is MySQL base connection)
volumes:
- mysql_data:/var/lib/mysql #Persist data if container removed
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql #Initialize database on container creation
networks:
- default
volumes:
mysql_data: