ARG PYTHON_VERSION=3.12.7 FROM python:${PYTHON_VERSION}-slim as base ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app ARG UID=10001 RUN adduser \ --disabled-password \ --gecos "" \ --home "/nonexistent" \ --shell "/bin/bash" \ --no-create-home \ --uid "${UID}" \ appuser RUN apt-get update && apt-get install -y \ build-essential \ gcc \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app COPY scripts/start_flower.sh /app/start_flower.sh RUN chmod a+x /app/start_flower.sh USER appuser CMD ["/app/start_flower.sh"]