Spaces:
Runtime error
Runtime error
Download Dockerfile from urstark/sonicapi-b: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/spaces/urstark/sonicapi-b/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/urstark/sonicapi-b/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/urstark/sonicapi-b/resolve/main/Dockerfile
791 Bytes
| # Use a slim Python image for efficiency | |
| FROM python:3.10-slim | |
| # Install system dependencies needed for tgcrypto and network tools | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| python3-dev \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user as required by Hugging Face Spaces | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy requirements first to leverage Docker cache | |
| COPY --chown=user requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the application code | |
| COPY --chown=user . /app | |
| # Hugging Face Spaces listen on port 7860 by default | |
| EXPOSE 7860 | |
| # Start the FastAPI app using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |