Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
198 lines (189 loc) · 4.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
198 lines (189 loc) · 4.66 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
services:
backend:
container_name: audioblocks-backend
build:
context: .
dockerfile: Dockerfile
ports:
- '4000:4000'
env_file: .env.docker
environment:
- NODE_ENV=development
depends_on:
- db
- redis
# RabbitMQ is optional for the minimal stack (API + DB + Redis). The
# backend starts without it and connects lazily; `docker compose up`
# (no profile) therefore omits rabbitmq. Use `--profile full` or
# `--profile queue` to include it.
volumes:
- .:/app
- /app/node_modules
- ./uploads:/app/uploads
healthcheck:
test:
[
'CMD',
'node',
'-e',
"require('http').get('http://localhost:4000/health/live', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
indexer:
container_name: audioblocks-indexer
build:
context: .
dockerfile: Dockerfile
command: ['npm', 'run', 'worker:indexer']
restart: unless-stopped
env_file: .env.docker
environment:
INDEXER_METRICS_PORT: 9464
depends_on:
db:
condition: service_healthy
profiles:
- full
- indexer
- monitoring
- observability
db:
container_name: audioblocks-db
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: audioblocks
ports:
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: redis-server
command: redis-server --maxmemory 200mb --maxmemory-policy volatile-lru
ports:
- '6379:6379'
restart: always
volumes:
- redisdata:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
restart: always
ports:
- '5050:80'
environment:
PGADMIN_DEFAULT_EMAIL: admin@local.com
PGADMIN_DEFAULT_PASSWORD: admin123
volumes:
- pgadmin_data:/var/lib/pgadmin
depends_on:
- db
profiles:
- full
- tools
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
restart: always
ports:
- '5672:5672'
- '15672:15672'
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
volumes:
- rabbitmq_data:/var/lib/rabbitmq
profiles:
- full
- queue
- messaging
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
ports:
- '9090:9090'
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
profiles:
- full
- monitoring
- observability
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- '3000:3000'
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_INSTALL_PLUGINS: ''
volumes:
- ./monitoring/grafana/provisioning.yml:/etc/grafana/provisioning/provisioning.yml:ro
- ./monitoring/dashboards:/etc/grafana/provisioning/dashboards:ro
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
profiles:
- full
- monitoring
- observability
loki:
image: grafana/loki:latest
container_name: loki
restart: always
ports:
- '3100:3100'
command: -config.file=/etc/loki/local-config.yaml
volumes:
- loki_data:/loki
profiles:
- full
- monitoring
- observability
promtail:
image: grafana/promtail:latest
container_name: promtail
restart: always
volumes:
- ./monitoring/promtail.yml:/etc/promtail/promtail.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
command: -config.file=/etc/promtail/promtail.yml
depends_on:
- loki
profiles:
- full
- monitoring
- observability
volumes:
pgdata:
redisdata:
pgadmin_data:
rabbitmq_data:
prometheus_data:
grafana_data:
loki_data: