File size: 573 Bytes
07db4f6
0c6b838
 
07db4f6
 
 
 
0c6b838
07db4f6
 
0c6b838
07db4f6
 
 
0c6b838
07db4f6
 
 
 
 
 
 
0c6b838
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 1. Gunakan Python 3.9 sebagai dasar
FROM python:3.9

# 2. Buat user baru (Hugging Face lebih suka ini daripada root)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:${PATH}"

# 3. Tentukan folder kerja
WORKDIR /home/user/app

# 4. Copy requirements dulu agar proses build lebih cepat
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# 5. Copy semua file kode kamu
COPY --chown=user . .

# 6. EXPOSE port 7860 (Pintu masuk resmi Hugging Face)
EXPOSE 7860

# 7. Jalankan aplikasi
CMD ["python", "app.py"]