pidgin/nest

Update stuff to work with newer hugo

2022-04-28, Gary Kramlich
eb368a232072
Update stuff to work with newer hugo

Testing Done:
Ran via `./dev-server.sh` and `npm run hugo:server` both of which were previously failing on `hugo v0.96.0+extended linux/amd64 BuildDate=unknown VendorInfo=debian:0.96.0-1`

Reviewed at https://reviews.imfreedom.org/r/1400/
#####################################################################
# setup up our node environment
#####################################################################
FROM docker.io/node:14-buster-slim as node-update-date
WORKDIR /nest/
COPY package-lock.json package.json ./
RUN apt-get update && \
apt-get install -y mercurial && \
apt-get clean && \
npm ci --production && \
npm cache clean --force
COPY .hg /nest/.hg
COPY hugo /nest/hugo
COPY tools /nest/tools
RUN node tools/update-lastmod.js
#####################################################################
# run the hugo build
#####################################################################
FROM docker.io/debian:bullseye as hugo-build
RUN set -ex && \
apt-get update && \
apt-get install -y golang hugo && \
apt-get clean && \
rm -rf /var/lib/apt/lists
ARG BUILD_NAME
ARG BUILD_DATE
ARG COMMIT
COPY --from=node-update-date /nest/hugo /nest/hugo
RUN hugo -s /nest/hugo -d /nest/public && \
cp /nest/public/post/index.xml /nest/public/rss.xml
#####################################################################
# setup up our node environment
#####################################################################
FROM docker.io/node:14-buster-slim as node-build
WORKDIR /nest/
COPY package-lock.json package.json ./
RUN npm ci --production && \
npm cache clean --force
COPY tools ./tools
COPY --from=hugo-build /nest/public public
RUN node tools/pre-prod.js
#####################################################################
# finally package everything up with rwgrim/goserve
#####################################################################
FROM docker.io/rwgrim/goserve
ENV GOSERVE_404_PAGE="/html/404.html"
COPY --from=node-build /nest/public /html/
EXPOSE 3000/tcp