Spaces:
Sleeping
Sleeping
| # Gunakan image Python 3.10 | |
| FROM python:3.10-slim | |
| # Set working directory awal | |
| WORKDIR /code | |
| # Copy requirements dan install dependencies | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Buat user baru dengan ID 1000 (Syarat wajib Hugging Face Spaces) | |
| RUN useradd -m -u 1000 user | |
| # Pindah ke user tersebut | |
| USER user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set working directory ke folder aplikasi user | |
| WORKDIR $HOME/app | |
| # Copy seluruh file aplikasi ke dalam container dengan permission user | |
| COPY --chown=user . $HOME/app | |
| # Expose port default Gradio (7860) | |
| EXPOSE 7860 | |
| # Jalankan aplikasi | |
| CMD ["python", "app.py"] | |