# Base Image Python 3.9 Slim FROM python:3.9-slim # Install Library Sistem untuk OpenCV (Debian Bookworm/Trixie Compatible) RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Setup User Non-Root (Standar Keamanan HF) RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" # Setup Direktori Kerja WORKDIR /app # Install Dependencies COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy File Aplikasi COPY --chown=user . /app # Expose Port & Jalankan EXPOSE 7860 CMD ["python", "app.py"]