#####################################################################
# setup up our node environment
#####################################################################
FROM node:14-buster-slim as node-update-date
COPY package-lock.json package.json ./
apt-get install -y mercurial && \
RUN node tools/update-lastmod.js
#####################################################################
#####################################################################
FROM debian:bullseye as hugo-build
apt-get install -y hugo && \
rm -rf /var/lib/apt/lists
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 node:14-buster-slim as node-build
COPY package-lock.json package.json ./
RUN npm ci --production && \
COPY --from=hugo-build /nest/public public
RUN node tools/pre-prod.js
#####################################################################
# finally package everything up with rwgrim/goserve
#####################################################################
ENV GOSERVE_404_PAGE="/html/404.html"
COPY --from=node-build /nest/public /html/