-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
273 lines (259 loc) · 9.89 KB
/
Copy pathdocker-compose.yml
File metadata and controls
273 lines (259 loc) · 9.89 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
x-default-logging: &logging
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
tag: "{{.Name}}"
volumes:
pg_data:
clickhouse_data:
clickhouse_coordination:
redpanda_data:
object_store_data:
networks:
meteroid_net:
name: meteroid-deploy
services:
### Infrastructure Services
meteroid-db:
image: ghcr.io/meteroid-oss/meteroid-postgres:18.3-standard
ports:
- '5432:5432'
user: postgres
environment:
- POSTGRES_USER=${DATABASE_USER:-meteroid}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME:-meteroid}
volumes:
- pg_data:/var/lib/postgresql
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}' ]
interval: 10s
timeout: 5s
retries: 5
command:
- "postgres"
- "-c"
- "wal_level=logical"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
networks:
- meteroid_net
logging: *logging
# Ensure clickhouse_coordination folders are setup with the correct user permissions
# clickhouse-server seems to use uid:gid -> 101:101, and default volume permissions are based on root
clickhouse-volume-init:
image: alpine:3.21
user: root
command:
- sh
- -c
- mkdir -p /coordination/log /coordination/snapshots && chown -R 101:101
/coordination
volumes:
- clickhouse_coordination:/coordination
restart: "no"
logging: *logging
clickhouse:
depends_on:
clickhouse-volume-init:
condition: service_completed_successfully
image: clickhouse/clickhouse-server:25.6.2-alpine
ports:
- 8123:8123
- 9000:9000
environment:
CLICKHOUSE_USER: ${CLICKHOUSE_USERNAME:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-default}
CLICKHOUSE_DB: ${CLICKHOUSE_DATABASE:-meteroid}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: wget --no-verbose --tries=1 --spider http://clickhouse:8123/ping || exit 1
interval: 5s
timeout: 3s
retries: 100
volumes:
- clickhouse_data:/var/lib/clickhouse
- clickhouse_coordination:/var/lib/clickhouse/coordination
- ./volume/clickhouse/config.xml:/etc/clickhouse-server/config.d/cluster.xml:ro
networks:
- meteroid_net
logging: *logging
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v23.3.1
hostname: redpanda
command:
- redpanda start
- --smp 1
- --memory 1G
- --overprovisioned
- --node-id 0
- --kafka-addr INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092
- --advertise-kafka-addr INTERNAL://redpanda:29092,EXTERNAL://localhost:9092
volumes:
- redpanda_data:/var/lib/redpanda/data
networks:
- meteroid_net
ports:
- 9092:9092
healthcheck:
test: [ "CMD-SHELL", "rpk cluster health | grep -E 'Healthy:.+true' || exit 1" ]
interval: 10s
timeout: 5s
retries: 10
logging: *logging
redpanda-topic-create:
image: docker.redpanda.com/redpandadata/redpanda:v23.3.1
depends_on:
redpanda:
condition: service_healthy
entrypoint:
- bash
- -c
- |
for topic in meteroid-events-raw; do \
echo "Creating topic: $$topic" && \
rpk topic create "$$topic" --brokers redpanda:29092 || true; \
done
networks:
- meteroid_net
### Meteroid Application Services
meteroid-api:
image: ghcr.io/meteroid-oss/meteroid-api:latest
depends_on:
meteroid-db:
condition: service_healthy
redpanda:
condition: service_healthy
ports:
- "8084:8084"
- "50061:50061"
environment:
- JWT_SECRET=${JWT_SECRET}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET}
- SECRETS_CRYPT_KEY=${SECRETS_CRYPT_KEY}
- DATABASE_URL=postgres://${DATABASE_USER:-meteroid}:${DATABASE_PASSWORD}@meteroid-db:5432/${DATABASE_NAME:-meteroid}?sslmode=disable
- METEROID_API_LISTEN_ADDRESS=0.0.0.0:50061
- METEROID_REST_API_LISTEN_ADDRESS=0.0.0.0:8084
- METERING_API_EXTERNAL_URL=http://metering-api:50062
- ENABLE_MULTI_ORGANIZATION=${ENABLE_MULTI_ORGANIZATION:-false}
- METEROID_PUBLIC_URL=${METEROID_PUBLIC_URL:-http://localhost:3000}
- OBJECT_STORE_URI=${OBJECT_STORE_URI:-file:///data/object-store}
- SVIX_JWT_TOKEN=${SVIX_JWT_TOKEN:-}
# # S3/MinIO configuration (only needed if using s3:// OBJECT_STORE_URI)
# - AWS_ALLOW_HTTP=${AWS_ALLOW_HTTP:-}
# - AWS_ENDPOINT=${AWS_ENDPOINT:-}
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
# # Optional: Webhook support via Svix
# - SVIX_SERVER_URL=${SVIX_SERVER_URL:-}
# # Optional: OAuth
# - OAUTH_GOOGLE_CLIENT_ID=${OAUTH_GOOGLE_CLIENT_ID:-}
# - OAUTH_GOOGLE_CLIENT_SECRET=${OAUTH_GOOGLE_CLIENT_SECRET:-}
# # Optional: Mail
# - MAILER_SMTP_HOST=${MAILER_SMTP_HOST:-}
# - MAILER_SMTP_USERNAME=${MAILER_SMTP_USERNAME:-}
# - MAILER_SMTP_PASSWORD=${MAILER_SMTP_PASSWORD:-}
# - MAILER_SMTP_TLS=${MAILER_SMTP_TLS:-false}
# - MAILER_FROM=${MAILER_FROM:-}
# # Optional: Telemetry
# - TELEMETRY_TRACING_ENABLED=${TELEMETRY_TRACING_ENABLED:-false}
# - TELEMETRY_METRICS_ENABLED=${TELEMETRY_METRICS_ENABLED:-false}
# - TELEMETRY_OTEL_ENDPOINT=${TELEMETRY_OTEL_ENDPOINT:-}
volumes:
- object_store_data:/data/object-store
healthcheck:
test: [ "CMD", "/bin/grpc_health_probe", "-addr=:50061" ]
interval: 10s
timeout: 5s
retries: 10
networks:
- meteroid_net
logging: *logging
meteroid-scheduler:
image: ghcr.io/meteroid-oss/meteroid-scheduler:latest
depends_on:
meteroid-db:
condition: service_healthy
meteroid-api:
condition: service_healthy
environment:
- JWT_SECRET=${JWT_SECRET}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET}
- SECRETS_CRYPT_KEY=${SECRETS_CRYPT_KEY}
- DATABASE_URL=postgres://${DATABASE_USER:-meteroid}:${DATABASE_PASSWORD}@meteroid-db:5432/${DATABASE_NAME:-meteroid}?sslmode=disable
- METEROID_API_LISTEN_ADDRESS=0.0.0.0:50061
- METEROID_REST_API_LISTEN_ADDRESS=0.0.0.0:8084
- METERING_API_EXTERNAL_URL=http://metering-api:50062
- ENABLE_MULTI_ORGANIZATION=${ENABLE_MULTI_ORGANIZATION:-false}
- METEROID_PUBLIC_URL=${METEROID_PUBLIC_URL:-http://localhost:3000}
- OBJECT_STORE_URI=${OBJECT_STORE_URI:-file:///data/object-store}
- SVIX_JWT_TOKEN=${SVIX_JWT_TOKEN:-}
# # S3/MinIO configuration (only needed if using s3:// OBJECT_STORE_URI)
# - AWS_ALLOW_HTTP=${AWS_ALLOW_HTTP:-}
# - AWS_ENDPOINT=${AWS_ENDPOINT:-}
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
# # Optional: Webhook support via Svix
# - SVIX_SERVER_URL=${SVIX_SERVER_URL:-}
# # Optional: OAuth
# - OAUTH_GOOGLE_CLIENT_ID=${OAUTH_GOOGLE_CLIENT_ID:-}
# - OAUTH_GOOGLE_CLIENT_SECRET=${OAUTH_GOOGLE_CLIENT_SECRET:-}
# # Optional: Mail
# - MAILER_SMTP_HOST=${MAILER_SMTP_HOST:-}
# - MAILER_SMTP_USERNAME=${MAILER_SMTP_USERNAME:-}
# - MAILER_SMTP_PASSWORD=${MAILER_SMTP_PASSWORD:-}
# - MAILER_SMTP_TLS=${MAILER_SMTP_TLS:-false}
# - MAILER_FROM=${MAILER_FROM:-}
# # Optional: Telemetry
# - TELEMETRY_TRACING_ENABLED=${TELEMETRY_TRACING_ENABLED:-false}
# - TELEMETRY_METRICS_ENABLED=${TELEMETRY_METRICS_ENABLED:-false}
# - TELEMETRY_OTEL_ENDPOINT=${TELEMETRY_OTEL_ENDPOINT:-}
networks:
- meteroid_net
logging: *logging
metering-api:
image: ghcr.io/meteroid-oss/metering-api:latest
depends_on:
clickhouse:
condition: service_healthy
redpanda:
condition: service_healthy
ports:
- "50062:50062"
environment:
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET}
- METERING_API_LISTEN_ADDRESS=0.0.0.0:50062
- METEROID_API_EXTERNAL_URL=http://meteroid-api:50061
- KAFKA_BOOTSTRAP_SERVERS=redpanda:29092
- KAFKA_RAW_TOPIC=${KAFKA_RAW_TOPIC:-meteroid-events-raw}
- CLICKHOUSE_DATABASE=${CLICKHOUSE_DATABASE:-meteroid}
- CLICKHOUSE_HTTP_ADDRESS=http://clickhouse:8123
- CLICKHOUSE_TCP_ADDRESS=clickhouse:9000
- CLICKHOUSE_USERNAME=${CLICKHOUSE_USERNAME:-default}
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-default}
- CLICKHOUSE_CLUSTER_NAME=${CLICKHOUSE_CLUSTER_NAME:-meteroid}
# Optional: Telemetry
- TELEMETRY_TRACING_ENABLED=${TELEMETRY_TRACING_ENABLED:-false}
- TELEMETRY_METRICS_ENABLED=${TELEMETRY_METRICS_ENABLED:-false}
- TELEMETRY_OTEL_ENDPOINT=${TELEMETRY_OTEL_ENDPOINT:-}
networks:
- meteroid_net
logging: *logging
meteroid-web:
image: ghcr.io/meteroid-oss/meteroid-web:latest
depends_on:
meteroid-api:
condition: service_healthy
ports:
- "3000:80"
environment:
- VITE_METEROID_API_EXTERNAL_URL=${VITE_METEROID_API_EXTERNAL_URL:-http://localhost:50061}
- VITE_METEROID_REST_API_EXTERNAL_URL=${VITE_METEROID_REST_API_EXTERNAL_URL:-http://localhost:8084}
networks:
- meteroid_net
logging: *logging