FROM python:3.9-slim # Set working directory early WORKDIR /app # Install system dependencies with cleanup RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ git \ libgl1-mesa-glx \ libglib2.0-0 \ build-essential \ python3-dev \ libjpeg-dev \ libpng-dev \ && rm -rf /var/lib/apt/lists/* # Copy only what’s needed early for caching COPY requirements.txt . COPY scripts ./scripts COPY configs ./configs # Upgrade pip + install Python deps RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Install LiveKit SDKs RUN pip install --no-cache-dir \ livekit==1.0.7 \ livekit-api==1.0.2 \ omegaconf \ transformers==4.39.3 \ && pip uninstall -y protobuf && pip install --no-cache-dir protobuf==3.20.3 # Install pose dependencies (with caching minimized) RUN pip install --no-cache-dir cython && \ pip install --no-cache-dir git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI RUN pip install --no-cache-dir mmengine==0.10.7 mmcv==2.0.0rc4 && \ pip install --no-cache-dir openmim && \ mim install mmpose && \ mim install mmdet # Copy rest of the code COPY . . # Final cleanup (in case anything big remains) RUN apt-get clean && \ find /root/.cache -type f -delete && \ rm -rf /root/.cache/pip # Set entrypoint # CMD ["python3", "-m", "scripts.realtime_inference", "--version", "v15", "--inference_config", "configs/inference/realtime.yaml"]