-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
66 lines (63 loc) · 1.44 KB
/
docker-compose-prod.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
version: '3.3'
services:
mongodb:
image: 'mongo:latest'
container_name: 'mongodb-chat'
restart: 'always'
ports:
- '27017:27017'
networks:
- chat-api-networks
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGODB_DATABASE}
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 20s
timeout: 10s
retries: 5
chat-api:
image: 'chat-api:latest'
container_name: 'chat-api'
environment:
SPRING_PROFILES_ACTIVE: 'prod'
SPRING_DATA_MONGODB_URI: ${MONGODB_URI}
JWT_SECRET: ${JWT_SECRET}
networks:
- chat-api-networks
ports:
- '8080:8080'
restart: on-failure
depends_on:
- mongodb
links:
- mongodb
prometheus:
image: 'prom/prometheus:latest'
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
networks:
- chat-api-networks
ports:
- '9090:9090'
grafana:
image: 'grafana/grafana:latest'
volumes:
- grafana_data:/var/lib/grafana
ports:
- 3000:3000
networks:
- chat-api-networks
depends_on:
prometheus:
condition: service_started
links:
- prometheus
networks:
chat-api-networks:
driver: bridge
volumes:
prometheus_data:
grafana_data: