livekit-voice-agent / Dockerfile
abubasith86's picture
Update Dockerfile
ec32a6f verified
FROM python:3.12-slim
# Create user for Hugging Face (required)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
UV_CACHE_DIR=/home/user/.cache/uv \
HF_HOME=/home/user/.cache/huggingface
WORKDIR $HOME/app
# Install system dependencies as root
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libatomic1 \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# Switch back to user
USER user
# Clone your repository to the correct location
RUN git clone https://github.com/abubasith456/voice-agent.git .
# Copy uv CLI tool (as root)
USER root
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
USER user
# Create cache directories with proper permissions
RUN mkdir -p $UV_CACHE_DIR $HF_HOME
# Create virtual environment
RUN uv venv --system-site-packages .venv
# Install dependencies
RUN . .venv/bin/activate && \
uv pip install -e . && \
rm -rf $UV_CACHE_DIR
# Make entrypoint executable
RUN chmod +x ./entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["./entrypoint.sh"]