# --- Stage 1: Build Zola site --- FROM alpine:3.20 AS builder RUN echo "@community https://dl-cdn.alpinelinux.org/alpine/v3.20/community" >> /etc/apk/repositories && \ apk add --no-cache git zola bash WORKDIR /site RUN git clone --depth=1 --recurse-submodules https://git.rbitton.com/rbitton/Website.git . WORKDIR /site/src RUN zola build --force # --- Stage 2: Runtime --- FROM python:3.12-alpine RUN apk add --no-cache nginx git zola bash COPY --from=builder /site /site COPY --from=builder /site/src/public /usr/share/nginx/html COPY --from=builder /site/webhook.py /usr/local/bin/webhook.py ENV DEPLOY_SECRET="supersecret" WORKDIR /site/src EXPOSE 80 5001 CMD sh -c "python3 /usr/local/bin/webhook.py & nginx -g 'daemon off;'"