Download Dockerfile from tejani/FASTAPI: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/tejani/FASTAPI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/tejani/FASTAPI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tejani/FASTAPI/resolve/main/Dockerfile
1.3 kB
| # Use an official Python runtime as the base image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies for git, OpenCV, OpenVINO, and other requirements | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| build-essential \ | |
| libpq-dev \ | |
| libgl1 \ | |
| libopencv-dev \ | |
| libblas-dev \ | |
| liblapack-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Clone the repository | |
| RUN git clone https://github.com/rupeshs/fastsdcpu.git . | |
| # Create a virtual environment | |
| RUN python -m venv env | |
| # Set environment variables for Hugging Face cache and OpenVINO telemetry | |
| ENV HF_HOME=/app/.cache/huggingface \ | |
| OPENVINO_TELEMETRY_DIR=/app/telemetry | |
| # Create cache, telemetry, configs, and results directories with write permissions | |
| RUN mkdir -p /app/.cache/huggingface /app/telemetry /app/configs /app/results && \ | |
| chmod -R 777 /app/.cache /app/telemetry /app/configs /app/results | |
| # Activate virtual environment and install Python dependencies | |
| RUN . env/bin/activate && pip install --no-cache-dir -r requirements.txt | |
| # Ensure the start-webserver.sh script is executable | |
| RUN chmod +x start-webserver.sh | |
| # Expose port (default to 8000, adjust if the script specifies another port) | |
| #EXPOSE 8000 | |
| # Run the start-webserver.sh script | |
| CMD ["./start-webserver.sh"] |