| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements file into the container | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Download and link the Spacy model inside the container | |
| RUN python -m spacy download en_core_web_sm | |
| # Copy the rest of the application code into the container | |
| COPY . . | |
| # Expose the port Streamlit runs on | |
| EXPOSE 8501 | |
| # Command to run the application | |
| CMD ["streamlit", "run", "app.py"] | |