fresh-orange-20958
11/06/2025, 10:31 PMtall-airline-16756
11/06/2025, 10:31 PMtall-airline-16756
11/06/2025, 10:31 PMlk agent dockerfile [working-dir] --overwrite
• [working-dir]: This is optional and points to your agent's working directory. If you don’t specify it, the current directory will be used.
• --overwrite: This flag lets the CLI overwrite any existing files if they’re already there.
The CLI is smart enough to detect whether you’re working with Node.js or Python and will generate the right Docker configurations for you.
Option 2: Manual Dockerfile Example (Node.js)
If you prefer to create it manually for a Node.js-based agent, here’s a production-ready Dockerfile example you can use:
# syntax=docker/dockerfile:1
FROM node:20-slim AS base
WORKDIR /app
RUN npm install -g pnpm@9.7.0
# Build stage
FROM base AS build
RUN apt-get update -qq && apt-get install --no-install-recommends -y ca-certificates
COPY --link . .
RUN pnpm install --frozen-lockfile
RUN npm run build
# Final stage
FROM base
COPY --from=build /app /app
COPY --from=build /etc/ssl/certs /etc/ssl/certs
EXPOSE 8081
CMD [ "node", "./dist/agent.js", "start" ]
This setup uses a lightweight Node.js base image, securely installs dependencies, and starts your agent with node ./dist/agent.js start. It’s a solid starting point!
Additional Notes
• If you’re working with Python agents, you might find the agent-starter-python repository really helpful for Dockerfile examples.
• Just a heads-up: make sure to follow LiveKit’s guidelines, like using a glibc-based base image and avoiding running your container as root for security reasons.
If you want to dive deeper, the LiveKit Agents Deployment Docs have plenty of useful information. Feel free to reach out if you have any questions—I’m here to help!
Sources: node-agent-example-docker/README.md | Deploying to custom environments | LiveKit Docs | Builds and Dockerfiles | LiveKit Docs | Community & Support | livekit/livekit_composite | DeepWiki | CLI Tools & Token Management | livekit/livekit_composite | DeepWiki