FROM alpine:3.22 AS base RUN apk add --no-cache python3 wireguard-tools iproute2 COPY agent.py /app/agent.py ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 HEALTHCHECK --interval=15s --timeout=5s --retries=3 CMD ["python3", "/app/agent.py", "--healthcheck"] ENTRYPOINT ["python3", "/app/agent.py"] FROM base AS test COPY test_agent.py /app/test_agent.py FROM base AS runtime