-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
144 lines (128 loc) · 3.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: "3.9"
services:
# monitored services
## an init service to migrate (and create, if needed) the database
init_database:
build: rails_app
environment:
- SERVICE_NAME=init_database
command: /rails/init_db.sh
env_file:
- .env_rails
depends_on:
- postgres
- promtail
## HTTP service - Rails app
web_app:
build: rails_app
environment:
- SERVICE_NAME=web_app
ports:
- "3000:3000"
env_file:
- .env_rails
depends_on:
init_database:
condition: service_completed_successfully
## async processing - Sidekiq app
async_processing_app:
build: rails_app
command: bundle exec sidekiq -C config/sidekiq.yml
environment:
- SERVICE_NAME=async_processing_app
env_file:
- .env_rails
depends_on:
init_database:
condition: service_completed_successfully
postgres:
image: postgres:16
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- ./volumes/postgres:/var/lib/postgresql/data:rw
depends_on:
- promtail
redis:
image: redis:7
volumes:
- ./volumes/redis:/data:rw
depends_on:
- promtail
# monitoring services
grafana:
image: grafana/grafana:11.2.1
volumes:
- ./volumes/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./volumes/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ports:
- "3001:3000"
## logging
promtail:
image: grafana/promtail:3.2.0
volumes:
- ./volumes/promtail/promtail-local-config.yaml:/etc/promtail/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/config.yaml
loki:
image: grafana/loki:3.2.0
command: [ "-config.file=/etc/loki/config.yaml" ]
volumes:
- ./volumes/loki/config.yaml:/etc/loki/config.yaml
ports:
- "3100:3100"
depends_on:
- minio
## tracing
otelcol:
image: otel/opentelemetry-collector-contrib:0.111.0
command: [ "--config=/etc/otelcol-config.yml" ]
volumes:
- ./volumes/opentelemetry-collector/otelcol-config.yml:/etc/otelcol-config.yml
depends_on:
- tempo
tempo:
image: grafana/tempo:2.6.0
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./volumes/tempo/tempo.yaml:/etc/tempo.yaml
- ./volumes/tempo/data:/tmp/tempo
ports:
- "3200:3200" # tempo metrics
- "4318:4318" # otlp http
depends_on:
- minio
## metrics
statsd-exporter:
image: prom/statsd-exporter:v0.27.1
command: "--statsd.mapping-config=/tmp/statsd_mapping.yml"
volumes:
- ./volumes/statsd-exporter:/tmp:ro
prometheus:
image: prom/prometheus:v2.54.1
command: --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --storage.tsdb.retention.time=30d
ports:
- "9090"
volumes:
- ./volumes/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
## general purpose object storage
minio:
image: minio/minio:RELEASE.2024-09-22T00-33-43Z
entrypoint:
- sh
- -euc
- |
mkdir -p /data/loki-data && \
mkdir -p /data/loki-ruler && \
mkdir -p /data/tempo-data && \
minio server /data
environment:
- MINIO_ROOT_USER=minio
- MINIO_ROOT_PASSWORD=supersecret
- MINIO_PROMETHEUS_AUTH_TYPE=public
- MINIO_UPDATE=off
volumes:
- ./volumes/minio:/data