# Gunakan base image Python yang ringan FROM python:3.9-slim # Atur direktori kerja di dalam container WORKDIR /app # Salin requirements.txt dan install library COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Salin semua file project ke dalam container COPY . . # Beri akses ke user non-root (Standar Keamanan Hugging Face) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user . $HOME/app # Buka port 7860 sesuai settingan app.py EXPOSE 7860 # Jalankan aplikasi CMD ["python", "app.py"]