-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (65 loc) · 1.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "80:8080"
- "8081:8081"
environment:
- SPRING_PROFILES_ACTIVE=prod
- mongodb.uri=mongodb:27017
volumes:
- ./target:/app/target
- ./logs:/app/logs
- ~/.m2:/root/.m2
command: [ "java", "-jar", "/app/app.jar" ]
networks:
- monitoring
mongodb:
image: mongo:7.0.9
container_name: mongodb
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: adminpw
MONGO_INITDB_DATABASE: demo
TZ: Asia/Taipei
volumes:
- ./database/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
ports:
- '27017:27017'
networks:
- monitoring
prometheus:
image: prom/prometheus
container_name: prometheus_demo
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- "9090:9090"
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus
networks:
- monitoring
grafana:
image: grafana/grafana
container_name: grafana_demo
ports:
- "3000:3000"
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./grafana:/etc/grafana/provisioning/datasources
networks:
- monitoring
volumes:
prom_data:
networks:
monitoring:
external: true