orange-nightfall-56903
10/02/2025, 6:15 AM# syntax=docker/dockerfile:1.7
ARG PYTHON_VERSION=3.11
FROM ghcr.io/astral-sh/uv:python${PYTHON_VERSION}-bookworm-slim
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
COPY pyproject.toml ./
RUN mkdir -p src
COPY . .
RUN chown -R appuser:appuser /app
USER appuser
ENV SKIP_SECRETS=1
ENV SKIP_GENERATE_PROMPTS=1
ENV DOWNLOAD_DIR=downloads
RUN uv run main.py download-files
CMD ["uv", "run", "main.py", "start"]
⚡ Ask:
Is there any recommended way to reduce the image size for LiveKit agents / Python apps? Would multi-stage builds or a different base image help here?brave-island-45242
10/02/2025, 7:03 PMpython:3.13-slim might help. Some other things:
• Are you sure you need to do COPY . .? Instead of doing something more targeted like COPY app/ ./app/
• You really shouldn't need uv in the final docker image for runtime. You only need them during build. (maybe something like COPY --from=builder /app/.venv /app/.venv could help? Don't forget to update the path env though)orange-nightfall-56903
10/09/2025, 9:16 AMbrave-island-45242
10/09/2025, 3:37 PMRUN uv sync --frozen --no-dev)? The only other thing that comes to mind right now is moving the download files step to a previous stage which might help with layering (that would help more with time than size though)