website/Dockerfile

30 lines
911 B
Docker

FROM klakegg/hugo:ext-alpine-onbuild AS builder
WORKDIR /src
COPY . .
# Build-time env vars used by Hugo templates.
ARG HUGO_MEMBERSHIP_FORM_ACTION=""
ARG HUGO_MEMBERSHIP_FORM_SUCCESS_PATH=""
ARG HUGO_FORMBRICKS_API_HOST=""
ARG HUGO_FORMBRICKS_ENV_ID=""
ARG HUGO_FORMBRICKS_EVENT=""
ARG HUGO_FORMBRICKS_SDK_URL=""
ENV HUGO_MEMBERSHIP_FORM_ACTION=$HUGO_MEMBERSHIP_FORM_ACTION
ENV HUGO_MEMBERSHIP_FORM_SUCCESS_PATH=$HUGO_MEMBERSHIP_FORM_SUCCESS_PATH
ENV HUGO_FORMBRICKS_API_HOST=$HUGO_FORMBRICKS_API_HOST
ENV HUGO_FORMBRICKS_ENV_ID=$HUGO_FORMBRICKS_ENV_ID
ENV HUGO_FORMBRICKS_EVENT=$HUGO_FORMBRICKS_EVENT
ENV HUGO_FORMBRICKS_SDK_URL=$HUGO_FORMBRICKS_SDK_URL
RUN mkdir -p /out \
&& hugo --config ./hugo.toml --environment production --minify --destination /out \
&& test -f /out/index.html
FROM nginx:1.27-alpine
COPY --from=builder /out /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]