-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (31 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ARG ALPINE_VERSION
ARG NGINX_VERSION
FROM alpine:${ALPINE_VERSION} AS builder
# Content below mostly from <https://github.com/jguyomard/docker-hugo/blob/c05479feeafd4eb2f9fc97a94834ac8f05b5a8db/Dockerfile>
# with some modifications for my site
ARG GIT_HASH
ARG VERSION
ARG RELEASE_DATE
LABEL maintainer="Steve Miller <[email protected]>"
LABEL version="${VERSION}"
LABEL git_hash="${GIT_HASH}"
LABEL release-date="${RELEASE_DATE}"
RUN apk add --no-cache \
curl \
git \
openssh-client \
rsync
# Updated to match version in Netlify
ENV HUGOVERSION 0.92.2
RUN mkdir -p /usr/local/src \
&& cd /usr/local/src \
&& curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGOVERSION}/hugo_${HUGOVERSION}_Linux-64bit.tar.gz | tar -xz \
&& mv hugo /usr/local/bin/hugo \
&& addgroup -Sg 1000 hugo \
&& adduser -SG hugo -u 1000 -h /src hugo
WORKDIR /src
COPY . /src
RUN hugo --buildFuture
# Build actual HTML serving directory
FROM nginx:${NGINX_VERSION}
COPY --from=builder /src/public /usr/share/nginx/html