diff --git a/Dockerfile b/Dockerfile index 5a49514..68aa41c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,12 @@ COPY package.json pnpm-lock.yaml ./ # --frozen-lockfile ensures we use exact versions from pnpm-lock.yaml for reproducible builds RUN pnpm install --frozen-lockfile +# Pre-download any ML models or files the agent needs +# This runs before COPY . . so the download layer is cached across code-only changes. +# The standalone CLI discovers installed @livekit/agents-plugin-* packages without +# loading your agent code. +RUN npx livekit-agents download-files + # Copy all remaining application files into the container # This includes source code, configuration files, and dependency specifications # (Excludes files specified in .dockerignore) @@ -42,12 +48,6 @@ COPY . . # Your package.json must contain a "build" script, such as `"build": "tsc"` RUN pnpm build -# Pre-download any ML models or files the agent needs -# This ensures the container is ready to run immediately without downloading -# dependencies at runtime, which improves startup time and reliability -# Your package.json must contain a "download-files" script, such as `"download-files": "pnpm run build && node dist/agent.js download-files"` -RUN pnpm download-files - # Remove dev dependencies for a leaner production image RUN pnpm prune --prod diff --git a/package.json b/package.json index fd7af93..a12a9fd 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "test": "vitest --run", "test:watch": "vitest", "dev": "pnpm run build && node dist/main.js dev", - "download-files": "pnpm run build && npx livekit-agents download-files", "start": "node dist/main.js start" }, "engines": {