this repo has no description
10
fork

Configure Feed

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

chore(indexer): move Fly config to project root for correct build context

The Dockerfile expects to be built from the project root (it COPYs the
top-level worker/, lib/, lexicons/ folders). When fly.toml lived inside
worker/, flyctl deployed with worker/ as the build context, which broke
those COPYs.

Move both files up one level and rename so they're easy to spot next to
the existing static and route folders:

worker/fly.toml -> fly.indexer.toml
worker/Dockerfile -> worker.Dockerfile

fly.indexer.toml now points at worker.Dockerfile and pins one always-on
shared-cpu-1x / 256MB machine with no public ports (Jetstream worker
holds a long-lived outbound WebSocket; nothing inbound to accept).

The Dockerfile gains a slightly fuller header comment explaining the
expected build context, and drops the obsolete --unstable-fs flag (not
needed on Deno 2.x).

Made-with: Cursor

+73 -43
+47
fly.indexer.toml
··· 1 + # Fly.io config for the Atmosphere registry indexer worker. 2 + # 3 + # This is a *background* worker — no public ports, no HTTP listener. 4 + # It opens a single WebSocket to Bluesky's Jetstream, fans events to 5 + # the Turso registry DB, and persists its cursor. 6 + # 7 + # Deploy from the project root: 8 + # 9 + # flyctl launch \ 10 + # --config fly.indexer.toml \ 11 + # --dockerfile worker.Dockerfile \ 12 + # --name atmosphere-registry-indexer \ 13 + # --region iad \ 14 + # --no-deploy --copy-config 15 + # 16 + # flyctl secrets set --config fly.indexer.toml \ 17 + # TURSO_DATABASE_URL=libsql://...turso.io \ 18 + # TURSO_AUTH_TOKEN=eyJ... \ 19 + # ATMOSPHERE_DID=did:plc:... 20 + # 21 + # flyctl deploy --config fly.indexer.toml --dockerfile worker.Dockerfile 22 + # 23 + # To watch it run: flyctl logs --config fly.indexer.toml 24 + 25 + app = "atmosphere-registry-indexer" 26 + primary_region = "iad" 27 + 28 + [build] 29 + dockerfile = "worker.Dockerfile" 30 + 31 + # Single always-on background process; no [http_service] block on 32 + # purpose — the indexer doesn't accept incoming connections. 33 + [processes] 34 + worker = "deno run -A worker/indexer.ts" 35 + 36 + [[vm]] 37 + size = "shared-cpu-1x" 38 + memory = "256mb" 39 + processes = ["worker"] 40 + 41 + # Don't auto-stop: the indexer must hold a long-lived WebSocket to 42 + # Jetstream and persist a cursor. Keep exactly one machine running. 43 + [[restart]] 44 + policy = "always" 45 + 46 + [deploy] 47 + strategy = "immediate"
+26
worker.Dockerfile
··· 1 + # Dockerfile for the Atmosphere registry indexer worker. 2 + # 3 + # Build context MUST be the project root, because we COPY whole top-level 4 + # folders (worker/, lib/, lexicons/) into the image. Fly's `flyctl deploy` 5 + # uses the directory containing the fly config as the context — so this 6 + # file lives at the project root, paired with fly.indexer.toml. 7 + FROM denoland/deno:2.1.4 8 + 9 + WORKDIR /app 10 + 11 + # Bring in just enough of the project to run worker/indexer.ts. 12 + COPY deno.json deno.lock ./ 13 + COPY worker ./worker 14 + COPY lib ./lib 15 + COPY lexicons ./lexicons 16 + COPY utils.ts ./utils.ts 17 + 18 + # Resolve and cache all transitive imports at build time so the container 19 + # starts cold quickly and doesn't try to pull from JSR/NPM at runtime. 20 + RUN deno cache worker/indexer.ts 21 + 22 + ENV DENO_ENV=production 23 + 24 + # -A grants the network/env/read perms the indexer needs (WebSocket to 25 + # Jetstream, HTTPS to PDSes, env vars for DB creds, file: DB in dev). 26 + CMD ["deno", "run", "-A", "worker/indexer.ts"]
-16
worker/Dockerfile
··· 1 - FROM denoland/deno:2.1.4 2 - 3 - WORKDIR /app 4 - 5 - COPY deno.json deno.lock ./ 6 - COPY worker ./worker 7 - COPY lib ./lib 8 - COPY i18n ./i18n 9 - COPY utils.ts ./utils.ts 10 - COPY lexicons ./lexicons 11 - 12 - RUN deno cache worker/indexer.ts 13 - 14 - ENV DENO_ENV=production 15 - 16 - CMD ["deno", "run", "-A", "--unstable-fs", "worker/indexer.ts"]
-27
worker/fly.toml
··· 1 - # Fly.io config for the Atmosphere registry indexer worker. 2 - # 3 - # Provision once: 4 - # fly launch --no-deploy --copy-config --name atmosphere-registry-indexer \ 5 - # --region iad --dockerfile worker/Dockerfile 6 - # fly secrets set TURSO_DATABASE_URL=... TURSO_AUTH_TOKEN=... \ 7 - # ATMOSPHERE_DID=did:plc:... 8 - # fly deploy 9 - # 10 - # This worker only needs ~256MB RAM and one persistent process; no public ports. 11 - 12 - app = "atmosphere-registry-indexer" 13 - primary_region = "iad" 14 - 15 - [build] 16 - dockerfile = "Dockerfile" 17 - 18 - [processes] 19 - worker = "deno run -A worker/indexer.ts" 20 - 21 - [[vm]] 22 - cpu_kind = "shared" 23 - cpus = 1 24 - memory_mb = 256 25 - 26 - [deploy] 27 - strategy = "immediate"