forked from LondheShubham153/Springboot-BankApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (43 loc) · 1.05 KB
/
docker-compose.yml
File metadata and controls
46 lines (43 loc) · 1.05 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
version: "3.8"
services:
mysql:
image: mysql:latest
container_name: mysql
environment:
- MYSQL_ROOT_PASSWORD=Test@123
- MYSQL_DATABASE=BankDB
volumes:
- bankapp-volume:/var/lib/mysql
networks:
- bankapp
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
mainapp:
image: ${DUSER}/${IMAGE}
container_name: Bankapp
environment:
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/BankDB?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
- SPRING_DATASOURCE_PASSWORD=Test@123
ports:
- "8080:8080"
depends_on:
mysql:
condition: service_healthy
networks:
- bankapp
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/actuator/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
bankapp:
volumes:
bankapp-volume: