Download Dockerfile from pcd2025/irkham: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/pcd2025/irkham/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/pcd2025/irkham/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/pcd2025/irkham/resolve/main/Dockerfile
1.09 kB
| # Menggunakan base image Python 3.13 versi slim agar lebih ringan | |
| FROM python:3.13-slim | |
| # Menghindari pembuatan file .pyc dan memastikan log muncul secara real-time | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Set direktori kerja di dalam container | |
| WORKDIR /app | |
| # Ganti bagian RUN apt-get sebelumnya dengan ini: | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy file requirements dan instal library | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy seluruh file project ke dalam container | |
| COPY . . | |
| # Perintah untuk mengumpulkan file statis ke folder 'staticfiles' | |
| RUN python manage.py collectstatic --noinput | |
| # Membuat tabel database yang hilang (myapp_document, dll) | |
| RUN python manage.py migrate --noinput | |
| # Port default yang diwajibkan oleh Hugging Face Spaces adalah 7860 | |
| EXPOSE 7860 | |
| # Jalankan Django menggunakan Gunicorn | |
| # Ganti 'Website' dengan nama folder yang berisi file wsgi.py kamu | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "config.wsgi"] |