-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (34 loc) · 1.6 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (34 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# syntax=docker/dockerfile:1
#
# Explicit, deterministic build for the freightutils-mcp stdio MCP server so
# Glama (and any sandbox builder) does NOT have to infer a Dockerfile.
#
# Everything below is DERIVED from the repo config, not guessed:
# - build command : package.json "scripts".build = "tsc"
# - build output dir : tsconfig.json "outDir" = "dist"
# - stdio entrypoint : package.json "bin".freightutils-mcp = "dist/bin/cli.js"
# - Node base : package.json "engines".node = ">=18" (open range, no
# pinned major) -> node:22-slim, the current Active LTS,
# which satisfies ">=18".
#
# The container starts the stdio MCP server with NO required environment.
# FREIGHTUTILS_API_KEY is OPTIONAL and only lifts the anonymous rate cap at
# tool-CALL time; initialize / tools/list / resources/list / prompts/list all
# succeed with no credentials — which is exactly how Glama introspects.
# ── Builder: install all deps and compile TypeScript -> dist ──────────────
FROM node:22-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# ── Runtime: production deps + compiled output only ───────────────────────
FROM node:22-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/dist ./dist
# Stdio transport speaks over stdin/stdout — no port to expose, no required env.
ENTRYPOINT ["node", "dist/bin/cli.js"]