| # Use a Python base image | |
| FROM python:3.9-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy the requirements file and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application script | |
| COPY app.py . | |
| # Expose the port Streamlit runs on | |
| EXPOSE 8501 | |
| # CRITICAL FIX: Use CMD to combine the execution command and filename | |
| # This ensures 'streamlit run app.py' is executed upon container start. | |
| CMD ["streamlit", "run", "app.py"] | |