Skip to content

Commit eb26216

Browse files
authored
Cache download-files in Dockerfile by using the module-level command (#79)
1 parent 5d1074e commit eb26216

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ RUN mkdir -p src
4848
# Ensure your uv.lock file is checked in for consistency across environments
4949
RUN uv sync --locked
5050

51+
# Pre-download any ML models or files the agent needs
52+
# This runs before COPY . . so the download layer is cached across code-only changes.
53+
# The module-level command discovers installed livekit-plugins-* packages without
54+
# loading your agent code.
55+
RUN uv run --module livekit.agents download-files
56+
5157
# Copy all remaining application files into the container
5258
# This includes source code, configuration files, and dependency specifications
5359
# (Excludes files specified in .dockerignore)
5460
COPY . .
5561

56-
# Pre-download any ML models or files the agent needs
57-
# This ensures the container is ready to run immediately without downloading
58-
# dependencies at runtime, which improves startup time and reliability
59-
RUN uv run "src/agent.py" download-files
60-
6162
# --- Production stage ---
6263
# Build tools (gcc, g++, python3-dev) are not included in the final image
6364
FROM base

0 commit comments

Comments
 (0)