See the best posts from any Bluesky account
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix deployment bootstrap: run migrations on web startup and wait on worker deps

- web service now runs `migration:run --force && clickhouse:migrate` before
starting the HTTP server, so SQLite and ClickHouse tables exist on first boot
- added healthcheck to web service (wget on :3333/) so workers only start after
migrations have completed and the HTTP server is up
- jetstream-worker and queue-worker now use `condition: service_healthy` on the
web dependency instead of the simple list form (fixes race on missing tables)
- made PORT and HOST optional in start/env.ts so worker processes (which boot
the full Adonis app but don't bind HTTP) pass env validation without needing
those vars set

Follow-up (out of scope for v1): I1 handle-change healing, I2 BACKFILL_MAX_POSTS
worker env wiring, I3 flushBuffer mutex.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+19 -5
+2 -2
apps/web/start/env.ts
··· 14 14 export default await Env.create(new URL('../', import.meta.url), { 15 15 // Node 16 16 NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const), 17 - PORT: Env.schema.number(), 18 - HOST: Env.schema.string({ format: 'host' }), 17 + PORT: Env.schema.number.optional(), 18 + HOST: Env.schema.string.optional({ format: 'host' }), 19 19 LOG_LEVEL: Env.schema.string(), 20 20 21 21 // App
+17 -3
docker-compose.yml
··· 14 14 15 15 web: 16 16 build: . 17 - command: node build/bin/server.js 17 + command: sh -c "node build/ace.js migration:run --force && node build/ace.js clickhouse:migrate && node build/bin/server.js" 18 18 depends_on: [clickhouse] 19 19 volumes: 20 20 - sqlite-data:/data ··· 35 35 QUEUE_DRIVER: database 36 36 ports: 37 37 - "3333:3333" 38 + healthcheck: 39 + test: ["CMD", "wget", "-qO-", "http://localhost:3333/"] 40 + interval: 2s 41 + timeout: 3s 42 + retries: 30 43 + start_period: 5s 38 44 39 45 jetstream-worker: 40 46 build: . 41 47 command: node build/ace.js jetstream:consume 42 - depends_on: [clickhouse, web] 48 + depends_on: 49 + clickhouse: 50 + condition: service_started 51 + web: 52 + condition: service_healthy 43 53 volumes: 44 54 - sqlite-data:/data 45 55 environment: ··· 60 70 queue-worker: 61 71 build: . 62 72 command: node build/ace.js queue:work 63 - depends_on: [clickhouse, web] 73 + depends_on: 74 + clickhouse: 75 + condition: service_started 76 + web: 77 + condition: service_healthy 64 78 volumes: 65 79 - sqlite-data:/data 66 80 environment: