-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
105 lines (98 loc) · 2.46 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
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
94
95
96
97
98
99
100
101
102
103
104
105
name: "producer-consumer"
services:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: "rabbitmq"
environment:
RABBITMQ_ERLANG_COOKIE: rabbitmq-prometheus
ports:
- 5672:5672
- 15672:15672
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- rabbitmq_net
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics ping"]
interval: 30s
timeout: 10s
retries: 5
restart: on-failure
cpu_count: 2
mem_limit: 1g
producer:
build:
context: ./producer
dockerfile: ./docker/Dockerfile
container_name: producer
ports:
- 3333:3333
command: npm run start
networks:
- rabbitmq_net
depends_on:
rabbitmq:
condition: service_healthy
restart: on-failure
cpu_count: 2
mem_limit: 1g
consumer:
build:
context: ./consumer
dockerfile: ./docker/Dockerfile
container_name: consumer
ports:
- "3334:3334"
command: npm run start
networks:
- rabbitmq_net
depends_on:
rabbitmq:
condition: service_healthy
restart: on-failure
cpu_count: 2
mem_limit: 1g
grafana:
image: grafana/grafana:8.3.4
container_name: grafana
ports:
- "3000:3000"
networks:
- "rabbitmq_net"
volumes:
- rabbitmq-prometheus_grafana:/var/lib/grafana
- ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/rabbitmq.yaml
- ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/prometheus.yaml
- ./grafana/dashboards:/dashboards
environment:
GF_AUTH_ANONYMOUS_ENABLED: true
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_INSTALL_PLUGINS: "flant-statusmap-panel,grafana-piechart-panel"
GF_SESSION_PROVIDER: "file"
GF_SESSION_PROVIDER_CONFIG: "/var/lib/grafana/sessions"
GF_SECURITY_COOKIE_SAMESITE: "none"
depends_on:
- prometheus
- consumer
- producer
prometheus:
image: prom/prometheus:v2.28.1
container_name: prometheus
networks:
- "rabbitmq_net"
ports:
- "9090:9090"
volumes:
- rabbitmq-prometheus_prometheus:/prometheus
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- rabbitmq
- consumer
- producer
networks:
rabbitmq_net:
driver: bridge
volumes:
rabbitmq-prometheus_prometheus:
rabbitmq-prometheus_grafana: