Spaces:
Runtime error
Runtime error
Download Dockerfile from sukatune/CodeVa-API: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/spaces/sukatune/CodeVa-API/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sukatune/CodeVa-API/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sukatune/CodeVa-API/resolve/main/Dockerfile
875 Bytes
| # Gunakan image dasar Python yang ringan | |
| FROM python:3.9-slim | |
| # Atur direktori kerja di dalam container | |
| WORKDIR /code | |
| # Set environment variable untuk mengubah lokasi cache Hugging Face | |
| ENV HF_HOME=/code/cache | |
| # --- PERBAIKAN DI SINI --- | |
| # Buat direktori cache dan berikan izin tulis untuk semua pengguna di dalam container | |
| RUN mkdir -p /code/cache && \ | |
| chmod -R 777 /code/cache | |
| # Salin file requirements terlebih dahulu untuk caching yang lebih baik | |
| COPY ./requirements.txt /code/requirements.txt | |
| # Instal semua library yang dibutuhkan | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Salin sisa kode aplikasi Anda | |
| COPY ./app.py /code/app.py | |
| # Beritahu Docker port mana yang akan digunakan oleh aplikasi | |
| EXPOSE 7860 | |
| # Perintah untuk menjalankan server saat container dimulai | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |