# ============================================================================= # Platform nginx + varnish — Rocky Linux 9 # nginx (TLS frontend) → Varnish (HTTP cache) → backend HTTP simple # ============================================================================= ARG BASE_IMAGE=rockylinux:9 # ── Stage 1 : build ja4ebpf (Rocky Linux, même toolchain que la prod) ───────── FROM rockylinux:9 AS go-builder # libbpf-devel est dans le dépôt CRB (CodeReady Builder) de Rocky Linux 9 RUN dnf install -y epel-release dnf-plugins-core && \ dnf config-manager --enable crb && \ dnf install -y \ golang \ clang \ llvm \ libbpf-devel \ kernel-headers \ bpftool \ make \ && \ dnf clean all WORKDIR /build COPY go.work go.work.sum* ./ COPY shared/go/ja4common/go.mod shared/go/ja4common/go.sum* ./shared/go/ja4common/ COPY services/ja4ebpf/go.mod services/ja4ebpf/go.sum* ./services/ja4ebpf/ RUN cd services/ja4ebpf && go mod download 2>/dev/null; true COPY shared/go/ja4common/ ./shared/go/ja4common/ COPY services/ja4ebpf/ ./services/ja4ebpf/ WORKDIR /build/services/ja4ebpf RUN GOWORK=off go generate ./internal/loader/ && \ GOWORK=off CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ go build -ldflags="-s -w" -o /out/ja4ebpf ./cmd/ja4ebpf/ # ── Runtime : nginx + varnish + backend + ja4ebpf ───────────────────────────── FROM ${BASE_IMAGE} RUN dnf install -y epel-release && \ dnf install -y --allowerasing procps-ng nginx varnish openssl curl python3 && \ dnf clean all COPY --from=go-builder /out/ja4ebpf /usr/local/bin/ja4ebpf # Certificat TLS auto-signé pour nginx RUN openssl req -x509 -nodes -days 365 \ -subj "/CN=platform.test" \ -newkey rsa:2048 \ -keyout /etc/pki/tls/private/nginx.key \ -out /etc/pki/tls/certs/nginx.crt && \ mkdir -p /var/www/html /var/log/nginx /run/nginx /run/varnish && \ echo '{"status":"ok","stack":"nginx-varnish"}' > /var/www/html/health COPY tests/integration/nginx-varnish/platform/nginx.conf /etc/nginx/nginx.conf COPY tests/integration/nginx-varnish/platform/varnish.vcl /etc/varnish/default.vcl COPY tests/integration/nginx-varnish/platform/ja4ebpf.yml /etc/ja4ebpf/config.yml COPY tests/integration/nginx-varnish/platform/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh EXPOSE 80 443 CMD ["/entrypoint.sh"]