Spaces:
Sleeping
Sleeping
Download Dockerfile from BhavyaPatel07/splitify-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/BhavyaPatel07/splitify-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/BhavyaPatel07/splitify-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/BhavyaPatel07/splitify-backend/resolve/main/Dockerfile
1.04 kB
| FROM python:3.10-slim | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PIP_NO_CACHE_DIR=1 | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| git \ | |
| libsndfile1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set up a new user named "user" with user ID 1000 to match Hugging Face's runtime user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set env variables pointing to the user's home directory | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| HF_HOME=/home/user/.cache/huggingface \ | |
| TORCH_HOME=/home/user/.cache/torch | |
| WORKDIR $HOME/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| COPY --chown=user . . | |
| # Run the downloader as user 'user' so weights are baked into the accessible home directory cache | |
| RUN cd js && python download_model.py | |
| EXPOSE 7860 | |
| # Launch uvicorn with --app-dir pointing at js/ so it finds app.py as | |
| # a top-level module (avoids the js.app package resolution overhead) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--app-dir", "js"] | |