-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdocker-compose.yml
52 lines (49 loc) Β· 1.2 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
51
52
services:
backend:
build:
context: ./backend
ports:
- "8080:8080"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/employee_management
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=password
- SPRING_DATA_MONGODB_URI=mongodb://mongodb:27017/employee_management
depends_on:
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/actuator/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
frontend:
build:
context: ./frontend
ports:
- "3000:80"
depends_on:
- backend
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: employee_management
ports:
- "3306:3306"
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -p'password'"]
interval: 30s
timeout: 10s
retries: 5
mongodb:
image: mongo:6.0
ports:
- "27017:27017"
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
retries: 5