Spaces:
Paused
Paused
Download Dockerfile from ilhamdev/imgtools-ai: direct link, hf CLI and curl.
- Browser
- Download file 896 Bytes
-
https://huggingface.co/spaces/ilhamdev/imgtools-ai/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ilhamdev/imgtools-ai/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ilhamdev/imgtools-ai/resolve/main/Dockerfile
896 Bytes
| FROM python:3.11-slim | |
| # Instal dependensi sistem yang dibutuhkan untuk OpenCV/Pillow/curl | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| curl \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Buat user non-root dengan UID 1000 untuk kompatibilitas Hugging Face Spaces | |
| RUN useradd -m -u 1000 user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Salin dependensi dan pasang dengan pip | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Salin seluruh kode aplikasi | |
| COPY --chown=user:user . . | |
| USER user | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "75"] | |