-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
231 lines (221 loc) · 6.23 KB
/
docker-compose.yml
File metadata and controls
231 lines (221 loc) · 6.23 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
services:
# background worker
worker:
restart: always
build:
context: .
dockerfile: ./apps/worker/Dockerfile
environment:
- DATABASE_URL=postgresql://postgres:postgres@pgbouncer:5432/main
- INDEXER_DATABASE_URL=postgresql://postgres:postgres@pgbouncer-indexer:5432/indexer
- REDIS_URL=redis://valkey:6379
healthcheck:
test: test ! -f /tmp/drain
interval: 5s
retries: 1
# websocket server
server:
restart: always
ports:
- "4000:3000"
build:
context: .
dockerfile: ./apps/server/Dockerfile
environment:
- REDIS_URL=redis://valkey:6379
- DATABASE_URL=postgresql://postgres:postgres@pgbouncer:5432/main
- INDEXER_DATABASE_URL=postgresql://postgres:postgres@pgbouncer-indexer:5432/indexer
healthcheck:
test: test ! -f /tmp/drain && curl -f http://localhost:3000
interval: 5s
retries: 1
# indexer processor
processor:
build:
context: .
dockerfile: apps/indexer/Dockerfile
restart: always
environment:
- FORCE_PRETTY_LOGGER=${INDEXER_FORCE_PRETTY_LOGGER}
- RPC_ENDPOINT=${INDEXER_RPC_ENDPOINT}
- RPC_RATE_LIMIT=${INDEXER_RPC_RATE_LIMIT}
- RPC_FINALITY=${INDEXER_RPC_FINALITY}
- SQD_ENDPOINT=${INDEXER_SQD_ENDPOINT}
- DB_URL=postgresql://postgres:postgres@postgres-indexer:5432/indexer
- DB_NAME=indexer
- DB_READ_USER=postgres-read
- DB_READ_PASS=postgres-read
- ENABLE_OBJEKTS=${INDEXER_ENABLE_OBJEKTS}
- ENABLE_GRAVITY=${INDEXER_ENABLE_GRAVITY}
- COSMO_PARALLEL_COUNT=${INDEXER_COSMO_PARALLEL_COUNT}
- REDIS_URL=redis://valkey:6379
# postgres database for indexer
postgres-indexer:
restart: always
image: postgres:18-alpine
ports:
- "5434:5432"
environment:
- POSTGRES_DB=indexer
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: "pg_isready -d indexer -U postgres"
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
volumes:
- postgres-indexer-data:/var/lib/postgresql
# pgbouncer for indexer
pgbouncer-indexer:
image: edoburu/pgbouncer:latest
restart: always
ports:
- "5435:5432"
environment:
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=postgres-indexer
- DB_NAME=indexer
- POOL_MODE=transaction
- AUTH_TYPE=scram-sha-256
- MAX_CLIENT_CONN=300
- MIN_POOL_SIZE=5
- DEFAULT_POOL_SIZE=20
- RESERVE_POOL_SIZE=5
- RESERVE_POOL_TIMEOUT=5
healthcheck:
test: ["CMD", "pg_isready", "-h", "localhost"]
# web
web:
restart: always
ports:
- "3000:3000"
build:
context: .
dockerfile: ./apps/web/Dockerfile
args:
- NEXT_PUBLIC_UMAMI_SCRIPT_URL
- NEXT_PUBLIC_UMAMI_WEBSITE_ID
- NEXT_PUBLIC_ACTIVITY_WEBSOCKET_URL
- BETTER_AUTH_SECRET
- DISCORD_CLIENT_ID
- DISCORD_CLIENT_SECRET
- TWITTER_CLIENT_ID
- TWITTER_CLIENT_SECRET
- NEXT_PUBLIC_SITE_URL
- DATABASE_URL=postgresql://postgres:postgres@pgbouncer:5432/main
- INDEXER_DATABASE_URL=postgresql://postgres:postgres@pgbouncer-indexer:5432/indexer
- S3_ENDPOINT=http://rustfs:9000
- S3_ACCESS_KEY=rustfsadmin
- S3_SECRET_KEY=rustfsadmin
- SES_REGION
- SES_ACCESS_KEY
- SES_SECRET_KEY
- SES_MAIL_FROM
- NEXT_PUBLIC_LIVE_API_KEY
- BYPASS_LIVE_KEY
- REDIS_URL=redis://valkey:6379
environment:
- NEXT_PUBLIC_UMAMI_SCRIPT_URL
- NEXT_PUBLIC_UMAMI_WEBSITE_ID
- NEXT_PUBLIC_ACTIVITY_WEBSOCKET_URL
- BETTER_AUTH_SECRET
- DISCORD_CLIENT_ID
- DISCORD_CLIENT_SECRET
- TWITTER_CLIENT_ID
- TWITTER_CLIENT_SECRET
- NEXT_PUBLIC_SITE_URL
- DATABASE_URL=postgresql://postgres:postgres@pgbouncer:5432/main
- INDEXER_DATABASE_URL=postgresql://postgres:postgres@pgbouncer-indexer:5432/indexer
- S3_ENDPOINT=http://rustfs:9000
- S3_ACCESS_KEY=rustfsadmin
- S3_SECRET_KEY=rustfsadmin
- SES_REGION
- SES_ACCESS_KEY
- SES_SECRET_KEY
- SES_MAIL_FROM
- NEXT_PUBLIC_LIVE_API_KEY
- BYPASS_LIVE_KEY
- REDIS_URL=redis://valkey:6379
healthcheck:
test: test ! -f /tmp/drain && curl -f http://localhost:3000/api/healthcheck
interval: 5s
retries: 1
# postgres database for web
postgres:
restart: always
image: postgres:18-alpine
volumes:
- postgres-data:/var/lib/postgresql
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=main
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# pgbouncer for web
pgbouncer:
image: edoburu/pgbouncer:latest
restart: always
ports:
- "5433:5432"
environment:
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=postgres
- DB_NAME=main
- POOL_MODE=transaction
- AUTH_TYPE=scram-sha-256
- MAX_CLIENT_CONN=300
- MIN_POOL_SIZE=5
- DEFAULT_POOL_SIZE=20
- RESERVE_POOL_SIZE=5
- RESERVE_POOL_TIMEOUT=5
healthcheck:
test: ["CMD", "pg_isready", "-h", "localhost"]
# redis compatible image
valkey:
restart: always
image: valkey/valkey:alpine
ports:
- "6379:6379"
# s3 compatible image
rustfs:
image: rustfs/rustfs:latest
ports:
- "9000:9000" # S3 API port
- "9001:9001" # Console port
environment:
- RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
- RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CORS_ALLOWED_ORIGINS=*
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
- RUSTFS_ACCESS_KEY=rustfsadmin
- RUSTFS_SECRET_KEY=rustfsadmin
volumes:
- rustfs-data:/data
restart: always
healthcheck:
test:
[
"CMD",
"sh",
"-c",
"curl -f http://127.0.0.1:9000/health && curl -f http://127.0.0.1:9001/rustfs/console/health",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres-data:
postgres-indexer-data:
rustfs-data: