From 6eed32ca14715119a1734333a2dfb183b159babf Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 26 Feb 2026 07:24:12 -0600 Subject: [PATCH] fix(api): add build tools for node-pty native compilation in Docker The terminal gateway (MS19) added node-pty which requires native compilation via node-gyp. The Docker build was missing python3, make, and g++ in the deps stage, causing pty.node to be absent at runtime and crashing the API on startup. Also adds openssl to the production stage to fix Prisma's libssl detection warning. Co-Authored-By: Claude Opus 4.6 --- apps/api/Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index cdd1d81..ff7a477 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -18,6 +18,12 @@ COPY turbo.json ./ # ====================== FROM base AS deps +# Install build tools for native addons (node-pty requires node-gyp compilation) +# and OpenSSL for Prisma engine detection +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 make g++ openssl \ + && rm -rf /var/lib/apt/lists/* + # Copy all package.json files for workspace resolution COPY packages/shared/package.json ./packages/shared/ COPY packages/ui/package.json ./packages/ui/ @@ -58,7 +64,11 @@ FROM node:24-slim AS production ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 /usr/local/bin/dumb-init # Single RUN to minimize Kaniko filesystem snapshots (each RUN = full snapshot) -RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx \ +# - openssl: Prisma engine detection requires libssl +# - No build tools needed here — native addons are compiled in the deps stage +RUN apt-get update && apt-get install -y --no-install-recommends openssl \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx \ && chmod 755 /usr/local/bin/dumb-init \ && groupadd -g 1001 nodejs && useradd -m -u 1001 -g nodejs nestjs -- 2.49.1