Files
kustomize/site/Dockerfile
Karl Isenberg 3bd9ea8ee7 chore: pin dev deps in the dev container
Copy package.json and package-lock.json into the site dev container
and use them to pin the versions and checksums for autoprefixer,
postcss-cli, and their dependencies.

This should help reduce risk of importing newer dependency versions
that haven't passed vulnerability checks.
2024-02-05 11:02:43 -08:00

53 lines
1.2 KiB
Docker

# Credit to Julien Guyomard (https://github.com/jguyomard)
# Credit to the Kubernetes Website team.
# This Dockerfile is based on:
# (https://github.com/kubernetes/website/blob/main/Dockerfile)
FROM docker.io/library/golang:1.20-alpine
RUN apk add --no-cache \
curl \
gcc \
g++ \
musl-dev \
build-base \
libc6-compat
ARG HUGO_VERSION
RUN mkdir $HOME/src && \
cd $HOME/src && \
curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz && \
cd "hugo-${HUGO_VERSION}" && \
go install --tags extended
FROM docker.io/library/golang:1.20-alpine
RUN apk add --no-cache \
runuser \
git \
openssh-client \
rsync \
npm
RUN mkdir -p /usr/local/node_packages
WORKDIR /usr/local/node_packages
COPY package.json ./
COPY package-lock.json ./
RUN npm install -D autoprefixer postcss-cli
ENV PATH="/usr/local/node_packages/node_modules/.bin:${PATH}"
RUN mkdir -p /var/hugo && \
addgroup -Sg 1000 hugo && \
adduser -Sg hugo -u 1000 -h /var/hugo hugo && \
chown -R hugo: /var/hugo && \
runuser -u hugo -- git config --global --add safe.directory /src
COPY --from=0 /go/bin/hugo /usr/local/bin/hugo
WORKDIR /src
USER hugo:hugo
EXPOSE 1313