# Use an official Python image as base FROM python:3.12-slim # Set environment variables to avoid interactive prompts during package installs ENV DEBIAN_FRONTEND=noninteractive # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ git \ && rm -rf /var/lib/apt/lists/* # Set up a new user named "user" with user ID 1000 RUN useradd -m -u 1000 user # Switch to the "user" user USER user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Install the project into `/app` WORKDIR $HOME/app # Copy all the app code to the docker COPY --chown=user . $HOME/app # Install cmbagent RUN pip install cmbagent>=0.0.1.post43 # This informs Docker that the container will listen on port 8501 at runtime. EXPOSE 8501 # Command to run the app HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health CMD ["cmbagent", "deploy"]