-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (40 loc) · 964 Bytes
/
docker-compose.yml
File metadata and controls
45 lines (40 loc) · 964 Bytes
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
version: "3.8"
services:
app:
build:
context: .
ports:
- "9090:9090"
depends_on:
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/mydb
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
SPRING_DATA_MONGODB_URI: mongodb://mongodb:27017/my_mongo_db
mysql:
image: mysql:8.0
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydb
healthcheck:
test: ["CMD", "mysql", "-uroot", "-proot", "-e", "SELECT 1"]
interval: 10s
timeout: 5s
retries: 5
mongodb:
image: mongo:6.0
restart: always
ports:
- "27017:27017"
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 })"]
interval: 10s
timeout: 5s
retries: 5