|
| 1 | +# DocForge — MCP server image (stdio). |
| 2 | +# |
| 3 | +# Runs dist/index.js (the MCP stdio server) directly — no Slack, no HTTP. |
| 4 | +# This is the image MCP directories (e.g. Glama) use to start the server and |
| 5 | +# probe it with introspection requests. For the Slack Agent delivery image, |
| 6 | +# see ./Dockerfile. |
| 7 | + |
| 8 | +# ---- build stage --------------------------------------------------------- |
| 9 | +FROM node:22-bookworm-slim AS build |
| 10 | +WORKDIR /app |
| 11 | + |
| 12 | +COPY package.json package-lock.json ./ |
| 13 | +RUN npm ci |
| 14 | + |
| 15 | +COPY tsconfig.json ./ |
| 16 | +COPY src ./src |
| 17 | +RUN npm run build |
| 18 | + |
| 19 | +# ---- runtime stage ------------------------------------------------------- |
| 20 | +FROM node:22-bookworm-slim AS runtime |
| 21 | +WORKDIR /app |
| 22 | +ENV NODE_ENV=production |
| 23 | + |
| 24 | +# Pinned Typst (same version/asset as CI). |
| 25 | +ARG TYPST_VERSION=0.14.2 |
| 26 | +ARG TYPST_SHA256=a6044cbad2a954deb921167e257e120ac0a16b20339ec01121194ff9d394996d |
| 27 | +RUN apt-get update \ |
| 28 | + && apt-get install -y --no-install-recommends curl xz-utils ca-certificates \ |
| 29 | + && curl -fsSL -o /tmp/typst.tar.xz "https://github.com/typst/typst/releases/download/v${TYPST_VERSION}/typst-x86_64-unknown-linux-musl.tar.xz" \ |
| 30 | + && echo "${TYPST_SHA256} /tmp/typst.tar.xz" | sha256sum -c - \ |
| 31 | + && tar -xJf /tmp/typst.tar.xz -C /tmp \ |
| 32 | + && mv /tmp/typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst \ |
| 33 | + && chmod +x /usr/local/bin/typst \ |
| 34 | + && apt-get purge -y curl xz-utils && apt-get autoremove -y \ |
| 35 | + && rm -rf /var/lib/apt/lists/* /tmp/typst-* /tmp/typst.tar.xz \ |
| 36 | + && typst --version |
| 37 | + |
| 38 | +# Production dependencies only. |
| 39 | +COPY package.json package-lock.json ./ |
| 40 | +RUN npm ci --omit=dev && npm cache clean --force |
| 41 | + |
| 42 | +# Build output + runtime assets. |
| 43 | +COPY --from=build /app/dist ./dist |
| 44 | +COPY templates ./templates |
| 45 | +COPY brand_kits ./brand_kits |
| 46 | +COPY packages ./packages |
| 47 | +COPY marketplace ./marketplace |
| 48 | +COPY vendor ./vendor |
| 49 | +COPY scripts ./scripts |
| 50 | + |
| 51 | +# Fail the build if Typst is below pin or a vendored package is missing. |
| 52 | +RUN node scripts/check-typst-version.mjs \ |
| 53 | + && node scripts/check-vendored-packages.mjs |
| 54 | + |
| 55 | +# Persisted document workspaces. |
| 56 | +ENV DOCFORGE_DATA_ROOT=/data/documents |
| 57 | +RUN mkdir -p /data/documents |
| 58 | +VOLUME ["/data"] |
| 59 | + |
| 60 | +# MCP server over stdio. |
| 61 | +CMD ["node", "dist/index.js"] |
0 commit comments