From b39d1a17a4348fd87a6ab7d0a3bf37885d32ab9c Mon Sep 17 00:00:00 2001 From: naman7474 Date: Sat, 4 Jul 2026 21:43:57 +0530 Subject: [PATCH] infra: Dockerfile + Railway config for the ingest sweep worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the third deployable — the v2 sweep worker (@lockstep/ingest). It runs `serve` (loop sweep, 15-min default), has no HTTP server, and talks to core over LOCKSTEP_API_URL. railway.ingest.json builds packages/ingest/Dockerfile with an ON_FAILURE restart policy and no healthcheck. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/ingest/Dockerfile | 16 ++++++++++++++++ railway.ingest.json | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 packages/ingest/Dockerfile create mode 100644 railway.ingest.json diff --git a/packages/ingest/Dockerfile b/packages/ingest/Dockerfile new file mode 100644 index 0000000..20b04ea --- /dev/null +++ b/packages/ingest/Dockerfile @@ -0,0 +1,16 @@ +# Built from the monorepo root context. The v2 ingest sweep worker: no HTTP server, +# it loops `sweep` on an interval and talks to core over LOCKSTEP_API_URL. +FROM node:20-alpine AS build +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build -w @lockstep/ingest + +FROM node:20-alpine AS run +WORKDIR /app +ENV NODE_ENV=production +COPY --from=build /app/node_modules ./node_modules +COPY --from=build /app/packages/ingest ./packages/ingest +# Loop: fetch → distill → propose, every 15 min (serve default). Env: LOCKSTEP_API_URL, +# LOCKSTEP_INGEST_TOKEN, COMPOSIO_API_KEY, ANTHROPIC_API_KEY. +CMD ["node", "packages/ingest/dist/index.js", "serve"] diff --git a/railway.ingest.json b/railway.ingest.json new file mode 100644 index 0000000..9184cd9 --- /dev/null +++ b/railway.ingest.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://railway.app/railway.schema.json", + "build": { + "builder": "DOCKERFILE", + "dockerfilePath": "packages/ingest/Dockerfile" + }, + "deploy": { + "restartPolicyType": "ON_FAILURE", + "restartPolicyMaxRetries": 5 + } +}