calm-gpu-73162
12/17/2025, 1:55 PMtall-airline-16756
12/17/2025, 1:55 PMtall-airline-16756
12/17/2025, 1:55 PMapps/agent subdirectory by telling the LiveKit CLI to use that directory as the build context.
1. From the monorepo root, deploy an existing agent:
lk agent deploy apps/agent
1. If the agent hasn’t been created yet:
lk agent create apps/agent --region <your-region>
Notes to ensure a successful deploy:
• apps/agent should contain the Dockerfile and livekit.toml (or pass --config to point to a different config).
• Provide required secrets (for example OPENAI_API_KEY) via --secrets, --secrets-file, or in livekit.toml.
• Ensure your Dockerfile is configured for your Node.js setup (base image, package manager like pnpm if used).
Would you like the exact command including secrets or an example livekit.toml for a Node.js agent?
Sources: Agent deployment CLI reference | LiveKit docs | Builds and Dockerfiles | LiveKit Docscalm-gpu-73162
12/17/2025, 2:00 PMtall-airline-16756
12/17/2025, 2:01 PMpackages/* are in build context:
docker build -f apps/agent/Dockerfile .
Or with LiveKit CLI:
lk agent deploy apps/agent
(Deploy will use the specified directory as build context.)
1. Use a workspace-aware package manager (pnpm, yarn/npm workspaces). Example pnpm setup:
• Root: pnpm-workspace.yaml includes packages/* and apps/agent.
• In apps/agent/package.json depend on local packages with workspace:*.
1. Adjust Dockerfile to copy root manifests, workspace config, packages, then install:
• COPY root files: package.json, pnpm-lock.yaml, pnpm-workspace.yaml.
• COPY packages and apps/agent into image.
• RUN pnpm install --frozen-lockfile
• WORKDIR /app/apps/agent then RUN pnpm build and CMD to start.
Minimal example:
FROM node:22-slim
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages ./packages
COPY apps/agent ./apps/agent
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN pnpm install --frozen-lockfile
WORKDIR /app/apps/agent
RUN pnpm build
CMD ["pnpm","start"]
1. Important notes
• Run builds from repo root (so packages/ are in context).
• Do not .dockerignore the needed packages/.
• Provide secrets via --secrets, --secrets-file, or livekit.toml when deploying with lk.
• Optimize by copying only package manifests for caching if you have many files.
Would you like a tailored Dockerfile using your repo structure or an example livekit.toml?
Sources: Builds and Dockerfiles | LiveKit Docs