# Use Python 3.11 base image FROM python:3.11-slim # Avoid warnings by setting environment variables ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ DEBIAN_FRONTEND=noninteractive # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ ffmpeg \ libsm6 \ libxext6 \ cmake \ rsync \ libgl1 \ && rm -rf /var/lib/apt/lists/* \ && git lfs install # Create a user for the app RUN useradd -m -u 1000 user WORKDIR /home/user/app USER user # Upgrade pip RUN pip install --upgrade pip # Copy requirements and install COPY --chown=user:user requirements.txt . RUN pip install -r requirements.txt # Copy the rest of the app COPY --chown=user:user . . # Default command to run your app CMD ["python", "app.py"]