# Package versions
ARG HUGO_VERSION="0.160.1"
ARG CADDY_VERSION="2.11.2"

# Stage 1: Build
FROM core.harbor.brds.ca/d-b.ca/hugo-builder:${HUGO_VERSION} AS builder
WORKDIR /project
COPY . .
RUN hugo --minify build

# Stage 2: Package
FROM docker.io/caddy:${CADDY_VERSION}
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /project/public /srv
# tls.crt and tls.key should be mounted here at runtime.
VOLUME /tls
