-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (47 loc) · 1.05 KB
/
docker-compose.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
43
44
45
46
47
48
49
50
name: mock_student_information_system_db
services:
mysql:
build:
context: ./backend/database
dockerfile: Dockerfile.mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: student_db
MYSQL_TCP_PORT: 3306
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
interval: 5s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
- DB_HOST=mysql
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=student_db
- DB_PORT=3306
- PORT=3001
depends_on:
mysql:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NEXT_PRIVATE_API_URL=http://backend:3001/api
- NEXT_PUBLIC_API_URL=http://localhost:3001/api
depends_on:
- backend
volumes:
mysql_data: