# Use an official Python runtime as a parent image FROM python:3.9-slim # Set a working directory for the application WORKDIR / # Copy the Python and system requirements files to the container COPY ./requirements.txt /requirements.txt COPY ./app.py /app.py COPY ./src/ /src/ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y \ build-essential \ libgomp1 \ && rm -rf /var/lib/apt/lists/* # Upgrade pip, setuptools, and wheel, then install Python dependencies RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt # Expose the port the app runs on EXPOSE 8501 # Define the command to run the app CMD streamlit run /app/app.py --server.address 0.0.0.0