Spaces:
Running
Running
Download Dockerfile from manojkumarsh/allbgremove-api: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/spaces/manojkumarsh/allbgremove-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/manojkumarsh/allbgremove-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/manojkumarsh/allbgremove-api/resolve/main/Dockerfile
671 Bytes
| FROM python:3.10 | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y ffmpeg libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* | |
| # Force install PyTorch CPU wheels explicitly | |
| RUN pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Set cache directories to an accessible location within the app | |
| ENV HF_HOME=/app/cache | |
| ENV TRANSFORMERS_CACHE=/app/cache | |
| COPY . . | |
| # Create cache directory and grant permissions | |
| RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |