| # 1. Start with a lightweight version of Python | |
| FROM python:3.10-slim | |
| # 2. Set the working directory inside the container | |
| WORKDIR /app | |
| # 3. Copy your requirements file into the container | |
| COPY requirements.txt . | |
| # 4. Install the Python packages | |
| # (We use --no-cache-dir to keep the container size small!) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 5. Copy the rest of your ml_services code into the container | |
| COPY . . | |
| # 6. Expose the port FastAPI will run on | |
| EXPOSE 7860 | |
| # 7. The command to start your server | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |