Skip to content

Commit

Permalink
Merge pull request #1141 from ScilifelabDataCentre/Paul/FREYA-751
Browse files Browse the repository at this point in the history
Pass `HUGO_ENV_ARG` to Hugo build in Dockerfile
  • Loading branch information
senthil10 authored May 20, 2024
2 parents aee9e79 + 0806260 commit 5df87ab
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
FROM alpine:3.19.1 AS build
RUN apk add --no-cache wget=1.21.4-r0
ARG HUGO_VERSION="0.123.7"
ARG HUGO_ENV_ARG
WORKDIR /src
COPY ./ /src
RUN wget --quiet "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
tar xzf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \
rm -r hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \
mv hugo /usr/bin && \
chmod 755 /usr/bin/hugo
WORKDIR /src
COPY ./ /src
RUN mkdir /target && \
hugo -d /target
chmod 755 /usr/bin/hugo && \
mkdir /target && \
hugo -d /target -e "${HUGO_ENV_ARG}"

# Serve the generated html using nginx
FROM nginxinc/nginx-unprivileged:alpine
Expand Down

0 comments on commit 5df87ab

Please sign in to comment.