A Docker/OCI image to include hugo (extended) and Golang (for hugo-modules).
$ docker run --rm ghcr.io/hostwithquantum/hugo-docker:latest version
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
The Image is pushed to multiple registries:
Incorporate into your own image:
# get a specific tag to avoid potential breaks
FROM ghcr.io/hostwithquantum/hugo-docker:latest as hugo
WORKDIR /website
ADD all-the-hugo-files .
RUN hugo --source . --destination public --minify
FROM nginxinc/nginx-unprivileged:1.25.3 as prod
COPY --from=hugo /website/public /usr/share/nginx/html
Build:
$ docker build -t mywebsite .
...
Deploy/run:
$ docker run --rm -p 80:8080 mywebsite:latest
...
Test: open http://localhost/