| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy project files | |
| COPY . /app | |
| # Upgrade pip first | |
| RUN pip install --no-cache-dir --upgrade pip | |
| # 🩵 Force reinstall the correct OpenAI SDK and install dependencies | |
| RUN pip uninstall -y openai || true | |
| RUN pip install --no-cache-dir openai==1.12.0 | |
| # Install the rest of the dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose the port (optional but useful for hosting) | |
| EXPOSE 7860 | |
| # Start the Flask API | |
| CMD ["python", "api.py"] | |