Docker & Helm
Run llmock as a container in Docker or deploy it to Kubernetes with the included Helm
chart. The image is based on node:22-alpine with zero runtime dependencies.
Docker
Build the image
docker build -t llmock .
Run with local fixtures
# Mount your fixture directory into the container
docker run -p 4010:4010 -v $(pwd)/fixtures:/fixtures llmock
# Custom port
docker run -p 5555:5555 llmock --fixtures /fixtures --port 5555
# Pull from GitHub Container Registry
docker pull ghcr.io/copilotkit/llmock:latest
docker run -p 4010:4010 -v $(pwd)/fixtures:/fixtures ghcr.io/copilotkit/llmock
Dockerfile
The multi-stage Dockerfile builds the TypeScript source and copies only the compiled output:
# --- Build stage ---
FROM node:22-alpine AS build
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY tsconfig.json tsdown.config.ts ./
COPY src/ src/
RUN pnpm run build
# --- Production stage ---
FROM node:22-alpine
WORKDIR /app
COPY --from=build /app/dist/ dist/
COPY fixtures/ fixtures/
EXPOSE 4010
ENTRYPOINT ["node", "dist/cli.js"]
CMD ["--fixtures", "/fixtures", "--host", "0.0.0.0"]
Helm Chart
Deploy to Kubernetes using the Helm chart in charts/llmock/.
Install
helm install llmock ./charts/llmock
# With custom values
helm install llmock ./charts/llmock \
--set image.tag=1.4.0 \
--set service.port=5555 \
--set replicaCount=2
Configuration (values.yaml)
replicaCount: 1
image:
repository: ghcr.io/copilotkit/llmock
tag: "" # defaults to Chart appVersion
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 4010
fixtures:
mountPath: /fixtures
existingClaim: "" # Use a PVC for fixture files
resources: {}
# limits:
# cpu: 200m
# memory: 256Mi
Fixture Loading
To load custom fixtures in Kubernetes, create a PersistentVolumeClaim with your fixture
JSON files and set fixtures.existingClaim in your values. The chart mounts
the PVC at fixtures.mountPath (default /fixtures).
Health Checks
The deployment includes liveness and readiness probes using TCP socket checks on the service port. Liveness starts after 5 seconds; readiness after 2 seconds.