FROM traefik:v3.2.0

ARG CORAZA_VERSION=v0.3.0
ARG CORAZA_MODULE=github.com/jcchavezs/coraza-http-wasm-traefik

RUN apk add --no-cache curl unzip \
  && mkdir -p /plugins-local/src/github.com/jcchavezs/coraza-http-wasm-traefik \
  && curl -fsSL -o /tmp/coraza.zip \
       "https://github.com/jcchavezs/coraza-http-wasm-traefik/releases/download/${CORAZA_VERSION}/coraza-http-wasm-${CORAZA_VERSION}.zip" \
  && unzip -q /tmp/coraza.zip -d /plugins-local/src/github.com/jcchavezs/coraza-http-wasm-traefik \
  && rm /tmp/coraza.zip
