FROM floryn90/hugo:0.155.1-alpine AS builder
WORKDIR /src
USER root
COPY hugo /src
RUN hugo --minify

FROM nginx:1.28.0-alpine-slim
COPY --from=builder /src/public /usr/share/nginx/html
HEALTHCHECK --interval=1m --timeout=10s --start-period=10s CMD wget -q -O /dev/null http://localhost/ || exit 1