Made it work, maybe you could update docs to have another example how to run it with uv (much better than pip) and a non root user:
FROM --platform=linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04 AS builder AS builder
# This prevents Python from writing out pyc files
ENV PYTHONDONTWRITEBYTECODE=1
# This keeps Python from buffering stdin/stdout
ENV PYTHONUNBUFFERED=1
# avoid stuck build due to user prompt
ARG DEBIAN_FRONTEND=noninteractive
ENV VIRTUAL_ENV=/app/venv \
PATH="$VIRTUAL_ENV/bin:$PATH" \
PATH="/root/.cargo/bin:$PATH" \
PATH="/app/.cargo/bin:$PATH"
RUN apt-get update && apt-get install curl -y && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /app
RUN groupadd -g 1001 docker_group && \
useradd -u 1001 -g 1001 -d /app -ms /bin/bash -c "Docker image user" docker_user
RUN chown -R docker_user:docker_group /app
USER docker_user
# install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
COPY requirements.txt .
# set up a virtual env and install requirements
RUN uv venv --python 3.11.9 ${VIRTUAL_ENV}
RUN uv pip install -r requirements.txt
FROM --platform=linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04 AS builder AS appcontainer
ENV PATH=/app/venv/bin:$PATH
ENV PATH=/root/.cargo/bin:$PATH
ENV PATH=/app/.cargo/bin:$PATH
COPY --from=builder /app /app
COPY admin.py /app/admin.py
EXPOSE 8051
HEALTHCHECK CMD curl --fail http://localhost:8051/_stcore/health
ENTRYPOINT ["streamlit", "run", "/app/admin.py"]