Spaces:
Sleeping
Sleeping
Download Dockerfile from MatteoAld/my_fastapi_endpoint: direct link, hf CLI and curl.
- Browser
- Download file 862 Bytes
-
https://huggingface.co/spaces/MatteoAld/my_fastapi_endpoint/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/MatteoAld/my_fastapi_endpoint/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/MatteoAld/my_fastapi_endpoint/resolve/main/Dockerfile
862 Bytes
| # Use an official Python runtime as a parent image | |
| FROM python:3.9-slim-buster | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the current directory contents into the container at /app | |
| # This includes main.py, requirements.txt, and the models/ directory | |
| COPY . /app | |
| # Install any needed packages specified in requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create a directory for your models if it doesn't exist | |
| # (though it should be copied from local) | |
| RUN mkdir -p models | |
| # Expose the port FastAPI will run on. Hugging Face Spaces often expects | |
| # port 7860 for web apps. | |
| EXPOSE 7860 | |
| # Command to run the Uvicorn server | |
| # The --host 0.0.0.0 makes the server accessible from outside the | |
| # container | |
| # The --port 7860 matches the EXPOSE instruction | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |