FROM python:3 AS build COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ WORKDIR /app RUN uv venv COPY requirements.txt . RUN uv pip install --system -r requirements.txt # Copy the project into the intermediate image ADD . /app FROM python:3-slim # Copy the environment, but not the source code COPY --from=build --chown=app:app /app/.venv /app/.venv RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app USER appuser CMD ["python", "scl.py"]