Skip to content

Commit f2449c9

Browse files
authored
Merge pull request tsparticles#5890 from tsparticles/v4
Dockerfile update for MCP server
2 parents ea5cbe1 + bcced5a commit f2449c9

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

integrations/mcp-server/Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
FROM node:22-alpine AS build
2-
# NOTE: pin this to a specific digest for fully reproducible/immutable
3-
# builds once you've verified one for your target platform(s), e.g.:
4-
# docker pull node:22-alpine && docker inspect --format='{{index .RepoDigests 0}}' node:22-alpine
5-
# then replace the line above with `FROM node:22-alpine@sha256:<digest> AS build`
6-
# (and the second FROM below with the same digest).
72
RUN corepack enable
83
WORKDIR /app
94

@@ -16,18 +11,21 @@ COPY integrations/mcp-server/package.json integrations/mcp-server/tsconfig.json
1611
COPY integrations/mcp-server/src/ ./integrations/mcp-server/src/
1712

1813
# Install only this package's dependencies
19-
RUN pnpm install --frozen-lockfile --filter @tsparticles/mcp-server
14+
RUN pnpm install --frozen-lockfile --filter @tsparticles/mcp-server --ignore-scripts
2015

2116
# Build
2217
RUN pnpm --filter @tsparticles/mcp-server exec tsc
2318

24-
# Prune to production deps only
25-
RUN pnpm --filter @tsparticles/mcp-server deploy --prod /tmp/app
19+
# Copy build output + package.json to a clean directory
20+
RUN mkdir -p /tmp/app && \
21+
cp -r integrations/mcp-server/dist /tmp/app/dist && \
22+
cp integrations/mcp-server/package.json /tmp/app/
23+
24+
# Install production deps outside the workspace
25+
WORKDIR /tmp/app
26+
RUN npm install --omit=dev --ignore-scripts
2627

2728
FROM node:22-alpine
28-
# tini acts as a proper PID 1: reaps zombie processes and forwards
29-
# signals (SIGTERM/SIGINT) to the Node process so graceful shutdown
30-
# actually runs instead of the container being killed outright.
3129
RUN apk add --no-cache tini
3230
RUN addgroup --system --gid 1001 app && adduser --system --uid 1001 app
3331
WORKDIR /app

0 commit comments

Comments
 (0)