FROM python:3.13-alpine3.23 AS builder ENV UV_SYSTEM_PYTHON=1 RUN apk update && apk add gcc libpq-dev musl-dev COPY pyproject.toml . RUN pip install uv && uv pip install -r pyproject.toml && pip uninstall -y uv FROM python:3.13-alpine3.23 COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages WORKDIR /code # Set user and group ARG user=apps ARG uid=1001 ARG gid=1001 RUN addgroup -S ${user} && adduser -S ${user} -G ${user} -u ${uid} -s /bin/sh RUN apk update && apk add gettext libpq RUN chown -R ${user}:${user} /code USER ${user} COPY --chown=${user}:${user} . /code RUN ["sh", "./scripts/prebuild.sh"] CMD ["sh", "./scripts/run.sh"]