FROM python:3.13-alpine AS validator

COPY ./scripts/check-content.py ./scripts/_schema.py /project/scripts/
COPY ./src /project/src
WORKDIR /project
RUN ["python3", "scripts/check-content.py"]

FROM ghcr.io/getzola/zola:v0.22.1 AS zola

COPY --from=validator /project/src /project
WORKDIR /project
RUN ["zola", "build"]

FROM ghcr.io/static-web-server/static-web-server:2

ENV SERVER_ROOT=/public
COPY --from=zola /project/public /public
