FROM alpine as builder

COPY . /opt/

WORKDIR /opt

RUN apk add --no-cache git hugo make && make build

FROM nginx

ARG SHA = "local-dev"
ARG BUILD_DATE = "03-11-2022"

LABEL org.opencontainers.image.created ${BUILD_DATE}
LABEL org.opencontainers.image.source https://git.vdhsn.com/adam/garden.git
LABEL org.opencontainers.image.url https://git.vdhsn.com/adam/garden
LABEL org.opencontainers.image.revision ${SHA}
LABEL org.opencontainers.image.licenses MIT
LABEL org.opencontainers.image.authors "Adam Veldhousen <adam@vdhsn.com>"

COPY --from=builder /opt/public /usr/share/nginx/html

EXPOSE 80
