Spaces:
Runtime error
Runtime error
Download Dockerfile from YasirAhmad0810/testFastAPI: direct link, hf CLI and curl.
- Browser
- Download file 781 Bytes
-
https://huggingface.co/spaces/YasirAhmad0810/testFastAPI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/YasirAhmad0810/testFastAPI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/YasirAhmad0810/testFastAPI/resolve/main/Dockerfile
781 Bytes
| FROM python:3.13.5-slim | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Install necessary dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements file to the working directory | |
| COPY requirements.txt ./ | |
| # Copy the FastAPI application files | |
| COPY src/ ./src/ | |
| # Install Python dependencies from requirements.txt | |
| RUN pip3 install -r requirements.txt | |
| # Expose the port that the FastAPI app will run on | |
| EXPOSE 7860 | |
| # Health check for FastAPI (adjust if needed) | |
| HEALTHCHECK CMD curl --fail http://localhost:7860/health || exit 1 | |
| # Set the entry point to run the FastAPI app with uvicorn | |
| ENTRYPOINT ["uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "7860"] | |