From 00c87c67a0c930831315d49c8809410233f8ce8e Mon Sep 17 00:00:00 2001 From: chana Date: Wed, 27 May 2026 12:16:09 -0700 Subject: [PATCH] Cache download-files in Dockerfile by using the module-level command --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a58dbc6..0016e73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,16 +48,17 @@ RUN mkdir -p src # Ensure your uv.lock file is checked in for consistency across environments RUN uv sync --locked +# 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 module-level command discovers installed livekit-plugins-* packages without +# loading your agent code. +RUN uv run --module 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) COPY . . -# 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 -RUN uv run "src/agent.py" download-files - # --- Production stage --- # Build tools (gcc, g++, python3-dev) are not included in the final image FROM base