-
Notifications
You must be signed in to change notification settings - Fork 68
/
docker-compose.yaml
160 lines (151 loc) · 4.86 KB
/
docker-compose.yaml
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
services:
kafka:
image: confluentinc/cp-kafka:7.7.1
ports:
- "127.0.0.1:29092:29092"
environment:
CLUSTER_ID: ca497efe-9f82-4b84-890b-d9969a9a2e1c
KAFKA_BROKER_ID: 0
KAFKA_PROCESS_ROLES: "broker,controller"
KAFKA_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093"
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://localhost:29092
KAFKA_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://0.0.0.0:29092,CONTROLLER://kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
JMX_PORT: 9997
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=9997"
healthcheck:
test: ["CMD-SHELL", "JMX_PORT=9998", "kafka-topics", "--bootstrap-server", "kafka:9092", "--list"]
interval: 5s
timeout: 3s
retries: 30
clickhouse:
image: clickhouse/clickhouse-server:24.9-alpine
ports:
- "127.0.0.1:8123:8123"
- "127.0.0.1:9000:9000"
- "127.0.0.1:9009:9009"
environment:
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: default
CLICKHOUSE_DB: openmeter
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD", "wget", "--spider", "http://clickhouse:8123/ping"]
interval: 5s
timeout: 3s
retries: 30
ch-ui:
image: ghcr.io/caioricciuti/ch-ui:latest
profiles:
- dev
depends_on:
- clickhouse
restart: always
ports:
- "${CH_UI_PORT:-5521}:5521"
environment:
VITE_CLICKHOUSE_URL: http://localhost:8123
VITE_CLICKHOUSE_USER: default
VITE_CLICKHOUSE_PASS: default
# Deduplication
# docker compose --profile redis up
redis:
profiles:
- redis
image: redis:7.0-alpine
ports:
- "127.0.0.1:6379:6379"
command: ["redis-server", "--maxmemory", "50mb", "--maxmemory-policy", "noeviction", "--maxmemory-samples", "10"]
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 5s
timeout: 3s
retries: 30
# Development
# docker compose --profile dev up
kafka-ui:
image: ghcr.io/kafbat/kafka-ui:main
profiles:
- dev
depends_on:
- kafka
ports:
- "127.0.0.1:8084:8080"
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_METRICS_PORT: 9997
DYNAMIC_CONFIG_ENABLED: "true"
healthcheck:
test: ["CMD", "wget", "--spider", "http://kafka-ui:8080/"]
interval: 10s
timeout: 5s
retries: 30
wiretap:
image: pb33f/wiretap:v0.0.49
profiles:
- dev
command: --config /usr/local/src/openmeter/etc/wiretap/config.docker.yaml
ports:
- 127.0.0.1:19090:19090
- 127.0.0.1:19091:19091
- 127.0.0.1:19092:19092
volumes:
- ./api:/usr/local/src/openmeter/api
- ./etc:/usr/local/src/openmeter/etc
# Credit
# docker compose --profile postgres up
postgres:
image: postgres:14.9-alpine
profiles:
- postgres
ports:
- "127.0.0.1:5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=postgres
configs:
- source: svix_sql
target: /docker-entrypoint-initdb.d/svix.sql
command: ["postgres", "-c", "wal_level=logical"]
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "$${POSTGRES_DB}", "-U", "$${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 30
svix:
image: svix/svix-server:v1.37
profiles:
- webhook
environment:
WAIT_FOR: "true" # We want to wait for the default services
SVIX_REDIS_DSN: "redis://redis:6379"
SVIX_DB_DSN: "postgresql://svix:svix@postgres/svix"
SVIX_CACHE_TYPE: "redis"
SVIX_JWT_SECRET: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MjI5NzYyNzMsImV4cCI6MjAzODMzNjI3MywibmJmIjoxNzIyOTc2MjczLCJpc3MiOiJzdml4LXNlcnZlciIsInN1YiI6Im9yZ18yM3JiOFlkR3FNVDBxSXpwZ0d3ZFhmSGlyTXUifQ.PomP6JWRI62W5N4GtNdJm2h635Q5F54eij0J3BU-_Ds"
SVIX_LOG_LEVEL: "info"
SVIX_QUEUE_TYPE: "redis"
ports:
- "127.0.0.1:8071:8071"
depends_on:
- postgres
- redis
configs:
svix_sql:
content: |
CREATE USER svix WITH PASSWORD 'svix';
CREATE DATABASE svix;
GRANT ALL PRIVILEGES ON DATABASE svix TO svix;
ALTER DATABASE svix OWNER TO svix;