diff --git a/integrations/mcp-server/Dockerfile b/integrations/mcp-server/Dockerfile index 868b0a0a319..4f005fa5b33 100644 --- a/integrations/mcp-server/Dockerfile +++ b/integrations/mcp-server/Dockerfile @@ -1,9 +1,4 @@ -FROM node:22-alpine AS build -# NOTE: pin this to a specific digest for fully reproducible/immutable -# builds once you've verified one for your target platform(s), e.g.: -# docker pull node:22-alpine && docker inspect --format='{{index .RepoDigests 0}}' node:22-alpine -# then replace the line above with `FROM node:22-alpine@sha256: AS build` -# (and the second FROM below with the same digest). +FROM node:24-alpine AS build RUN corepack enable WORKDIR /app @@ -16,18 +11,21 @@ COPY integrations/mcp-server/package.json integrations/mcp-server/tsconfig.json COPY integrations/mcp-server/src/ ./integrations/mcp-server/src/ # Install only this package's dependencies -RUN pnpm install --frozen-lockfile --filter @tsparticles/mcp-server +RUN pnpm install --frozen-lockfile --filter @tsparticles/mcp-server --ignore-scripts # Build RUN pnpm --filter @tsparticles/mcp-server exec tsc -# Prune to production deps only -RUN pnpm --filter @tsparticles/mcp-server deploy --prod /tmp/app +# Copy build output + package.json to a clean directory +RUN mkdir -p /tmp/app && \ + cp -r integrations/mcp-server/dist /tmp/app/dist && \ + cp integrations/mcp-server/package.json /tmp/app/ -FROM node:22-alpine -# tini acts as a proper PID 1: reaps zombie processes and forwards -# signals (SIGTERM/SIGINT) to the Node process so graceful shutdown -# actually runs instead of the container being killed outright. +# Install production deps outside the workspace +WORKDIR /tmp/app +RUN npm install --omit=dev --ignore-scripts + +FROM node:24-alpine RUN apk add --no-cache tini RUN addgroup --system --gid 1001 app && adduser --system --uid 1001 app WORKDIR /app diff --git a/package.json b/package.json index 84059713999..d78a51fdc2f 100644 --- a/package.json +++ b/package.json @@ -78,5 +78,5 @@ "webpack-cli": "^7.2.1", "yargs": "^18.0.0" }, - "packageManager": "pnpm@11.10.0" + "packageManager": "pnpm@11.11.0" }