| # Base image | |
| FROM python:3.9-slim | |
| # Working directory | |
| WORKDIR /app | |
| # Copy requirements and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY app.py . | |
| # Expose port | |
| EXPOSE 8000 | |
| # Automatically start the app | |
| CMD ["python", "app.py"] | |