Spaces:
Running
Running
# Gunakan Python image | |
FROM python:3.10-slim | |
# Set environment variables untuk cache Hugging Face agar tidak nulis ke /.cache | |
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers | |
ENV HF_HOME=/tmp/huggingface | |
# Set working directory | |
WORKDIR /app | |
# Salin semua file ke container | |
COPY . . | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Buat folder cache yang bisa ditulis | |
RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface | |
# Expose port yang digunakan Flask | |
EXPOSE 7860 | |
# Jalankan aplikasi Flask | |
CMD ["python", "app.py"] | |