-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
251 lines (239 loc) · 8.04 KB
/
docker-compose.dev.yml
File metadata and controls
251 lines (239 loc) · 8.04 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
name: validatorinfo
networks:
default:
name: validatorinfo_default
observability:
external: true
name: validatorinfo_observability
services:
db:
image: pgvector/pgvector:pg14
container_name: validatorinfo-dev-db
command: postgres -c max_connections=500
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
events-db:
image: postgres:14-bullseye
container_name: validatorinfo-dev-events-db
command: postgres -c max_connections=500
environment:
POSTGRES_DB: ${EVENTS_POSTGRES_DB:-validatorinfo_events_db}
POSTGRES_USER: ${EVENTS_POSTGRES_USER:-validatorinfo_events_user}
POSTGRES_PASSWORD: ${EVENTS_POSTGRES_PASSWORD:-events_password}
ports:
- "5433:5432"
volumes:
- postgres_events_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${EVENTS_POSTGRES_USER:-validatorinfo_events_user} -d ${EVENTS_POSTGRES_DB:-validatorinfo_events_db}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:latest
container_name: validatorinfo-dev-redis
ports:
- "6371:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
main-migrations:
container_name: validatorinfo-dev-main-migrations
build:
context: .
dockerfile: Dockerfile
target: migrations
command: >
sh -c "
echo 'Running main database migrations...' &&
npx prisma migrate deploy &&
echo 'Generating main Prisma client...' &&
npx prisma generate
"
depends_on:
db:
condition: service_healthy
env_file:
- .env
environment:
# Override with Docker-specific database connection
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
volumes:
- uploads_data:/app/uploads
events-migrations:
container_name: validatorinfo-dev-events-migrations
build:
context: .
dockerfile: Dockerfile
target: migrations
command: >
sh -c "
echo 'Running events database migrations...' &&
npx prisma migrate deploy --schema=prisma/events/schema.prisma &&
echo 'Generating events Prisma client...' &&
npx prisma generate --schema=prisma/events/schema.prisma
"
depends_on:
events-db:
condition: service_healthy
env_file:
- .env
environment:
# Override with Docker-specific database connection
EVENTS_DATABASE_URL: postgresql://${EVENTS_POSTGRES_USER:-validatorinfo_events_user}:${EVENTS_POSTGRES_PASSWORD:-events_password}@events-db:5432/${EVENTS_POSTGRES_DB:-validatorinfo_events_db}?schema=public
volumes:
- uploads_data:/app/uploads
init-chains:
container_name: validatorinfo-dev-init-chains
build:
context: .
dockerfile: Dockerfile
target: migrations
command: >
sh -c "
echo 'Flushing Redis and initializing chains...' &&
redis-cli -h redis flushall &&
npx tsx server/tools/init-chains.ts
"
depends_on:
main-migrations:
condition: service_completed_successfully
events-migrations:
condition: service_completed_successfully
redis:
condition: service_healthy
env_file:
- .env
environment:
# Override with Docker-specific connections
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
EVENTS_DATABASE_URL: postgresql://${EVENTS_POSTGRES_USER:-validatorinfo_events_user}:${EVENTS_POSTGRES_PASSWORD:-events_password}@events-db:5432/${EVENTS_POSTGRES_DB:-validatorinfo_events_db}?schema=public
volumes:
- uploads_data:/app/uploads
init-podcasts:
container_name: validatorinfo-dev-init-podcasts
build:
context: .
dockerfile: Dockerfile
target: migrations
command: >
sh -c "npx tsx server/tools/init-podcasts.ts"
depends_on:
init-chains:
condition: service_completed_successfully
env_file:
- .env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
volumes:
- uploads_data:/app/uploads
# Note: For full observability stack, run docker-compose-observability.yml
# Alloy collector is in docker-compose-observability.yml
frontend:
container_name: validatorinfo-dev-frontend
build:
context: .
dockerfile: Dockerfile
target: frontend
args:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
EVENTS_DATABASE_URL: postgresql://${EVENTS_POSTGRES_USER:-validatorinfo_events_user}:${EVENTS_POSTGRES_PASSWORD:-events_password}@events-db:5432/${EVENTS_POSTGRES_DB:-validatorinfo_events_db}?schema=public
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
events-db:
condition: service_healthy
init-chains:
condition: service_completed_successfully
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "sh", "-c", "pgrep -f 'node.*server.ts' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
env_file:
- .env
environment:
# Override with Docker-specific connections
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
EVENTS_DATABASE_URL: postgresql://${EVENTS_POSTGRES_USER:-validatorinfo_events_user}:${EVENTS_POSTGRES_PASSWORD:-events_password}@events-db:5432/${EVENTS_POSTGRES_DB:-validatorinfo_events_db}?schema=public
REDIS_HOST: redis
REDIS_PORT: "6379"
SERVER_PORT: "3000"
PUBLIC_URL: ${PUBLIC_URL}
# OpenTelemetry Configuration
OTEL_ENABLED: ${OTEL_ENABLED:-false}
OTEL_SERVICE_NAME: ${OTEL_SERVICE_NAME_FRONTEND:-validatorinfo-frontend}
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://alloy:4317}
PYROSCOPE_SERVER_URL: ${PYROSCOPE_SERVER_URL:-http://pyroscope:4040}
volumes:
- uploads_data:/app/uploads
networks:
- default
- observability
indexer:
container_name: validatorinfo-dev-indexer
build:
context: .
dockerfile: Dockerfile
target: indexer
ports:
- "3001:3001"
depends_on:
db:
condition: service_healthy
events-db:
condition: service_healthy
init-chains:
condition: service_completed_successfully
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "sh", "-c", "pgrep -f 'tsx.*indexer.ts' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
env_file:
- .env
environment:
# Override with Docker-specific connections
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
EVENTS_DATABASE_URL: postgresql://${EVENTS_POSTGRES_USER:-validatorinfo_events_user}:${EVENTS_POSTGRES_PASSWORD:-events_password}@events-db:5432/${EVENTS_POSTGRES_DB:-validatorinfo_events_db}?schema=public
REDIS_HOST: redis
REDIS_PORT: "6379"
# OpenTelemetry Configuration
OTEL_ENABLED: ${OTEL_ENABLED:-false}
OTEL_SERVICE_NAME: ${OTEL_SERVICE_NAME_INDEXER:-validatorinfo-indexer}
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://alloy:4317}
PYROSCOPE_SERVER_URL: ${PYROSCOPE_SERVER_URL:-http://pyroscope:4040}
volumes:
- uploads_data:/app/uploads
- ./logs:/app/logs
networks:
- default
- observability
volumes:
postgres_data_dev:
postgres_events_data:
uploads_data: