Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Keep the build context small and force a clean rebuild of dist/.
**/node_modules
**/dist
apps
.git
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# syntax=docker/dockerfile:1

# ─── Build stage ─────────────────────────────────────────────────────────────
# Builds only the three workspace packages the MCP server needs, in dependency
# order (platform → api → mcp). Deliberately skips apps/* (Electron/Monaco),
# which the MCP server does not use — keeps the build small and reliable.
FROM node:22-bookworm-slim AS build
WORKDIR /app

# CI=true turns each package's `prepare` script into a no-op, so `npm install`
# never triggers an out-of-order build. We build explicitly, in order, below.
ENV CI=true

# Minimal workspace root — only packages/*, never apps/*.
RUN printf '{"name":"rds-mcp-build","private":true,"workspaces":["packages/*"]}\n' > package.json

# Each package's tsconfig extends ../../tsconfig.base.json.
COPY tsconfig.base.json ./

# Only the three packages in the dependency graph.
COPY packages/roku-dev-studio-platform/ packages/roku-dev-studio-platform/
COPY packages/roku-dev-studio-api/ packages/roku-dev-studio-api/
COPY packages/roku-dev-studio-mcp/ packages/roku-dev-studio-mcp/

# Installs deps for all three workspaces; inter-workspace deps link locally.
RUN npm install

# esbuild bundles api + platform (and the prose .md files) into a single,
# self-contained dist/index.cjs for the MCP server.
RUN npm run build --workspace roku-dev-studio-platform \
&& npm run build --workspace roku-dev-studio-api \
&& npm run build --workspace roku-dev-studio-mcp

# ─── Runtime stage ───────────────────────────────────────────────────────────
# The bundle inlines every dependency, so the runtime image needs nothing but
# Node and the single .cjs file.
FROM node:22-bookworm-slim AS runtime
WORKDIR /app
COPY --from=build /app/packages/roku-dev-studio-mcp/dist/index.cjs ./index.cjs

# Speaks MCP (JSON-RPC 2.0) over stdio. Glama's introspection driver connects
# here; initialize / tools|resources|prompts.list are answered with no Roku
# device, desktop app, or bridge socket present.
ENTRYPOINT ["node", "/app/index.cjs"]