From 347769a1156d69fa02f79b3ae7cd350f964a48a1 Mon Sep 17 00:00:00 2001 From: Onyeka Nwamba Date: Tue, 26 May 2026 17:55:49 +0100 Subject: [PATCH] fix: install runtime dependencies in Railway image --- Dockerfile | 5 ++++- test/repo-cleanup.test.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f25a7bb..a37fdbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ -FROM node:22-alpine +FROM node:24-alpine WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev --ignore-scripts + COPY sdk/typescript/package.json sdk/typescript/package-lock.json ./sdk/typescript/ RUN npm --prefix sdk/typescript ci diff --git a/test/repo-cleanup.test.js b/test/repo-cleanup.test.js index ff5860c..0bce8cb 100644 --- a/test/repo-cleanup.test.js +++ b/test/repo-cleanup.test.js @@ -169,6 +169,19 @@ test("runtime scripts execute TypeScript entrypoints directly", async () => { assert.equal(tsconfig.compilerOptions.checkJs, undefined); }); +test("Railway Docker image installs root runtime dependencies", async () => { + const dockerfile = await readFile("Dockerfile", "utf8"); + + assert.match(dockerfile, /^FROM node:24-alpine$/m); + assert.match(dockerfile, /^COPY package\.json package-lock\.json \.\/$/m); + assert.match(dockerfile, /^RUN npm ci --omit=dev --ignore-scripts$/m); + + const rootInstallIndex = dockerfile.indexOf("RUN npm ci --omit=dev --ignore-scripts"); + const sourceCopyIndex = dockerfile.indexOf("COPY . ."); + assert.ok(rootInstallIndex >= 0); + assert.ok(sourceCopyIndex > rootInstallIndex); +}); + async function findSideBySideSourceDuplicates(roots) { const duplicates = [];