dockerfile

This commit is contained in:
Ben Cherry
2025-08-11 16:22:18 -07:00
parent d0f967cebd
commit 83c1eb0069
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -16,4 +16,5 @@ __pycache__
README.md
LICENSE
.github
tests/
tests/
+6 -2
View File
@@ -10,6 +10,10 @@ FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1
# Define the program entrypoint file where your agent is started
ARG PROGRAM_MAIN="src/agent.py"
ENV PROGRAM_MAIN=${PROGRAM_MAIN}
# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
ARG UID=10001
@@ -61,7 +65,7 @@ RUN uv sync --locked
# 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
RUN uv run "$PROGRAM_MAIN" download-files
# Expose the healthcheck port
# This allows Docker and orchestration systems to check if the container is healthy
@@ -70,4 +74,4 @@ EXPOSE 8081
# Run the application using UV
# UV will activate the virtual environment and run the agent
# The "start" command tells the worker to connect to LiveKit and begin waiting for jobs
CMD ["uv", "run", "src/agent.py", "start"]
CMD ["uv", "run", "$PROGRAM_MAIN", "start"]