Adapter refactor
All checks were successful
ci/woodpecker/push/tests Pipeline was successful

Allows using different ways to retrieve hosts IP address
This commit is contained in:
Sonny Bakker 2025-05-03 13:12:13 +02:00 committed by sonny
parent 97cf1a8f5c
commit 84558826fb
15 changed files with 861 additions and 710 deletions

View file

@ -1,15 +1,24 @@
FROM python:3.11-alpine
ARG LOGGING_CONFIG_SRC="./transip_client/logging/default.yml"
ARG LOGGING_CONFIG_DST="./transip_client/logging/config.yml"
ARG UV_ARGS=""
COPY --from=ghcr.io/astral-sh/uv:python3.11-alpine /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:python3.11-alpine \
/usr/local/bin/uv \
/usr/local/bin/uvx \
/bin/
# provides the dig package for the DNSAdapter
RUN apk add --no-cache bind-tools
# copy from the cache instead of linking since mounted volumes are used
ENV UV_LINK_MODE=copy
ENV UV_CACHE_DIR=/app/.cache/uv
ENV PATH="/app/.venv/bin:$PATH"
ENV LOGGING_CONFIG=$LOGGING_CONFIG_DST
RUN useradd --uid 1000 transip_client
RUN adduser -DHu 1000 transip_client
USER transip_client
@ -25,9 +34,10 @@ RUN --mount=type=cache,uid=1000,target=/app/.cache/uv \
COPY pyproject.toml uv.lock /app
COPY transip_client /app/transip_client
COPY $LOGGING_CONFIG_SRC $LOGGING_CONFIG_DST
# install dependencies + project
RUN --mount=type=cache,uid=1000,target=/app/.cache/uv \
uv sync --frozen --no-dev $UV_ARGS
ENTRYPOINT ["transip-listen"]
ENTRYPOINT ["/bin/uv", "run", "--no-sync", "--", "transip-listen"]