FROM docker:27-cli@sha256:851f91d241214e7c6db86513b270d58776379aacc5eb9c4a87e5b47115e3065c AS dockercli FROM python:3.11-slim@sha256:a3ab0b966bc4e91546a033e22093cb840908979487a9fc0e6e38295747e49ac0 WORKDIR /app/api # The API runs as root by design: it drives iptables, the docker socket, and # docker-execs into sibling containers. Non-root is not feasible here. COPY --from=dockercli /usr/local/bin/docker /usr/local/bin/docker RUN apt-get update \ && apt-get install -y --no-install-recommends \ wireguard-tools \ iptables \ iproute2 \ util-linux \ curl \ ca-certificates \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /app/data /app/config COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . EXPOSE 3000 CMD ["python", "app.py"]