Spaces:
Runtime error
Runtime error
Download Dockerfile from chetanganatra/test-api: direct link, hf CLI and curl.
- Browser
- Download file 539 Bytes
-
https://huggingface.co/spaces/chetanganatra/test-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/chetanganatra/test-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/chetanganatra/test-api/resolve/main/Dockerfile
539 Bytes
| # Gunakan Python versi ringan | |
| FROM python:3.10-slim | |
| # Set direktori kerja | |
| WORKDIR /app | |
| # Salin file dependency | |
| COPY requirements.txt . | |
| # Instal dependensi | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Set environment variable untuk cache huggingface ke direktori yang bisa ditulis | |
| ENV TRANSFORMERS_CACHE=/tmp/hf | |
| ENV HF_HOME=/tmp/hf | |
| # Salin seluruh isi project ke container | |
| COPY . . | |
| # Jalankan aplikasi FastAPI dengan uvicorn di port 7860 (standar Hugging Face) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |