Spaces:
Sleeping
Sleeping
| # Use a lightweight Python base image | |
| FROM python:3.11-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install git so we can clone the repo | |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
| # Clone the repository directly into the container | |
| # (Replace the URL if you are using a different repo) | |
| RUN git clone https://github.com/dhiaaeddine16/duckduckgo-ai-openai-api.git . | |
| # Install dependencies (this will be lightning fast on HF) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Hugging Face Spaces strictly routes web traffic to port 7860 | |
| EXPOSE 7860 | |
| # We use uvicorn directly to override any hardcoded ports in the script | |
| # and force it to bind to Hugging Face's required port (7860) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |