split Docker build into phases

- as per https://github.com/gohugoio/hugo/issues/12991
This commit is contained in:
Drew Bowering 2025-05-10 07:38:16 -06:00
parent ef6b699072
commit 0622c2a858
Signed by: drew
GPG Key ID: DC9462335BDDAC6B

View File

@ -3,10 +3,11 @@ ARG HUGO_VERSION="v0.147.1"
ARG CADDY_VERSION="2.10.0"
# Stage 1: Build
FROM ghcr.io/gohugoio/hugo:${HUGO_VERSION} AS builder
WORKDIR /project
FROM ghcr.io/gohugoio/hugo:${HUGO_VERSION} AS source
COPY . .
RUN hugo build
FROM source AS builder
RUN /entrypoint.sh build
# Stage 2: Package
FROM docker.io/caddy:${CADDY_VERSION}