-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (52 loc) · 1.38 KB
/
docker-compose.yml
File metadata and controls
55 lines (52 loc) · 1.38 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
54
55
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
environment:
REACT_APP_API_URL: http://backend:8080
ports:
- "3000:8080"
depends_on:
- backend
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_PASSWORD: password
MYSQL_DATABASE: employee_management
ports:
- "3306:3306"
healthcheck:
test: ["CMD-SHELL", "mysql -h127.0.0.1 -P3306 -p'password' -u'root' -D'employee_management' -e 'SELECT 1;'"]
interval: 30s
timeout: 10s
retries: 10
mongodb:
image: mongo:6.0
ports:
- "27017:27017"
healthcheck:
test: ["CMD-SHELL", "echo 'db.runCommand({ ping: 1 }).ok' | mongosh --quiet localhost:27017 | grep 1"]
interval: 30s
timeout: 10s
retries: 5