| # Use the official Python base image | |
| FROM python:3.9-slim | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Copy the requirements file into the container | |
| COPY requirements.txt ./ | |
| # Install the Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all your application files (like app.py) into the container | |
| COPY . . | |
| # Expose the port that Streamlit runs on | |
| EXPOSE 8501 | |
| # The command to run your Streamlit app when the container starts | |
| # Using the preferred "exec" form to avoid shell syntax errors | |
| CMD ["streamlit", "run", "app.py"] |