Spaces:
Runtime error
Runtime error
Download Dockerfile from sinan7/extract_api: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/spaces/sinan7/extract_api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sinan7/extract_api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sinan7/extract_api/resolve/main/Dockerfile
739 Bytes
| # Use a lightweight Python runtime | |
| FROM python:3.11-slim | |
| # Set the working directory in the container | |
| WORKDIR /code | |
| # Copy the requirements file and install dependencies | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Create writable cache directory for Hugging Face models | |
| RUN mkdir -p /code/hf_cache && chmod -R 777 /code/hf_cache | |
| # Set environment variables for Hugging Face cache | |
| ENV HF_HOME=/code/hf_cache | |
| # Copy the application code | |
| COPY ./main.py /code/main.py | |
| # Expose the application port | |
| EXPOSE 7860 | |
| # Start the FastAPI application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300"] | |