| # Use an official Python runtime as a parent image | |
| FROM python:3.11-slim | |
| # Set environment variables to ensure logs are printed immediately | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the requirements file into the container | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the app files into the container | |
| COPY app.py . | |
| COPY NEW_AI_INFRA.html . | |
| # Expose the port Flask runs on | |
| EXPOSE 7860 | |
| # Run the application | |
| # Note: We set host to 0.0.0.0 so it's accessible outside the container | |
| CMD ["python", "app.py"] | |