# syntax=docker/dockerfile:1 # # Xexéu image: one binary covering both Compose roles (`serve` and `scanner`). # The default image carries no external scanner; nmap lives in the optional # variant xexeu-scanner-nmap so the NPSL stays out of the standard binary. # Build stage. FROM rust:1.99-slim-trixie AS build RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /src COPY Cargo.toml Cargo.lock ./ COPY crates crates RUN cargo build --release --locked -p xexeu-cli # Runtime stage: Debian slim, the binary and CA certificates for the optional # outbound feed sync, release check and HEALTHCHECK. Runs unprivileged by # default; the compose `scanner` service overrides the user to gain NET_RAW. FROM debian:trixie-slim RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl libstdc++6 \ && rm -rf /var/lib/apt/lists/* \ && groupadd --system --gid 10001 xexeu \ && useradd --system --uid 10001 --gid 10001 --home-dir /data --shell /usr/sbin/nologin xexeu \ && mkdir -p /data/xexeu /data/sweeps \ && chown xexeu:xexeu /data/xexeu COPY --from=build /src/target/release/xexeu /usr/local/bin/xexeu LABEL org.opencontainers.image.title="Xexéu" \ org.opencontainers.image.description="Continuous attack-surface and vulnerability auditing" \ org.opencontainers.image.source="https://git.lucasrguerra.dev.br/ciberfauna/xexeu" \ org.opencontainers.image.licenses="MIT OR Apache-2.0" ENV XEXEU_RUNTIME=container USER xexeu WORKDIR /data EXPOSE 8788 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD curl -fsS http://127.0.0.1:8788/api/health >/dev/null || exit 1 ENTRYPOINT ["xexeu"] CMD ["serve", "--bind", "0.0.0.0:8788", "--config", "/config/xexeu.toml", \ "--sweeps", "/data/sweeps", "--data-dir", "/data/xexeu"]