Spaces:
Sleeping
Sleeping
Download Dockerfile from Rohxn08/ZipRoute-API: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/Rohxn08/ZipRoute-API/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Rohxn08/ZipRoute-API/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Rohxn08/ZipRoute-API/resolve/main/Dockerfile
1.11 kB
| FROM python:3.11-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install system dependencies required for OpenCV and PaddleOCR | |
| # Changed libgl1-mesa-glx to libgl1 which is available in Debian trixie | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| build-essential \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| wget \ | |
| git \ | |
| python3-opencv \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements file first to leverage Docker cache | |
| COPY requirements.txt . | |
| # Upgrade pip and install Python dependencies | |
| RUN pip install --upgrade pip setuptools wheel && \ | |
| pip install -r requirements.txt | |
| # Copy the rest of the application files | |
| COPY backend /app/backend | |
| COPY eta_prediction_model.pkl /app/eta_prediction_model.pkl | |
| COPY model_columns.pkl /app/model_columns.pkl | |
| COPY .env /app/.env | |
| # Set up environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| # Make sure Python can find modules inside /app | |
| ENV PYTHONPATH=/app | |
| # Start the FastAPI app using Uvicorn | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |