| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set environment variables for FastAPI, transformers, etc. | |
| ENV HOME=/app | |
| ENV XDG_CONFIG_HOME=/app/.config | |
| ENV XDG_CACHE_HOME=/app/.cache | |
| # Create config/cache directories | |
| RUN mkdir -p /app/.config /app/.cache | |
| # Copy requirements first for caching and install dependencies | |
| COPY requirements.txt ./ | |
| # Install Python dependencies, including watsonx orchestrate | |
| RUN pip install --upgrade pip && \ | |
| pip install --upgrade ibm-watsonx-orchestrate && \ | |
| pip install -r requirements.txt | |
| # Copy the rest of your app | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |