-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
59 lines (56 loc) · 1.39 KB
/
docker-compose.yaml
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
56
57
58
59
services:
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- "8080:8080"
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
volumes:
- ./backend:/app
- /app/target
# Below is required for Hot Reload
- ~/.m2:/root/.m2 # Cache Maven dependencies
- ./backend/src:/app/src # Mount the source code
- ./backend/target:/app/target # Mount the target directory
ports:
- "5000:5000"
environment:
- DB_HOST=mysql
- DB_PORT=3306
- DB_NAME=system_integration
- DB_USERNAME=myuser
- DB_PASSWORD=mypassword
- DB_ROOT_PASSWORD=my-secret-pw
command: mvn spring-boot:run
depends_on:
mysql:
condition: service_healthy
mysql:
container_name: db-mysql
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: my-secret-pw
MYSQL_DATABASE: system_integration
MYSQL_USER: myuser
MYSQL_PASSWORD: mypassword
volumes:
- mysql-data:/var/lib/mysql
ports:
# - "3306:3306"
- "3307:3306" # Map local port 3307 to container port 3306
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3
volumes:
mysql-data: