FROM python:3.12-slim ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 WORKDIR /app # Install system dependencies including curl for healthcheck and supervisor RUN apt-get update && apt-get install -y \ build-essential \ wget \ curl \ supervisor \ && rm -rf /var/lib/apt/lists/* # Create a non-root user to run the application RUN useradd -m -u 1000 appuser # Copy the entire project directory # .dockerignore should exclude .venv and other unnecessary files COPY . . # Install uv and dependencies RUN pip install --no-cache-dir --upgrade pip && \ pip install uv && \ uv venv /app/.venv && \ . /app/.venv/bin/activate && \ uv pip install . && \ uv sync # Set environment variable to use the venv ENV PATH="/app/.venv/bin:$PATH" # Create supervisor configuration RUN mkdir -p /etc/supervisor/conf.d COPY <