-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
compose.yml
93 lines (87 loc) · 1.85 KB
/
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
services:
api:
container_name: go-api
build:
context: .
dockerfile: Dockerfile
image: go-api
ports:
- 8080:8080
env_file:
- .env.example
environment:
- MONGO_URI=mongodb://mongo:27017
- REDIS_URI=redis:6379
networks:
- go-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 5
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
develop:
watch:
- path: .
action: rebuild
mongo:
container_name: go-mongodb
image: mongo:8.0.0
volumes:
- mongodbdata:/data/db
networks:
- go-network
healthcheck:
test: ["CMD", "pgrep", "mongod"]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
redis:
container_name: go-redis
image: redis:7.4
volumes:
- redisdata:/data
ports:
- 6379:6379
networks:
- go-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
prometheus:
container_name: prometheus
image: prom/prometheus:v2.55.0
volumes:
- ./Docker/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- 9090:9090
networks:
- go-network
grafana:
container_name: grafana
image: grafana/grafana:11.3.0
volumes:
- ./Docker/grafana.yml:/etc/grafana/provisioning/datasources/datasource.yaml
- grafana-data:/var/lib/grafana
ports:
- 3000:3000
networks:
- go-network
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password
volumes:
mongodbdata:
redisdata:
grafana-data:
networks:
go-network:
driver: bridge