-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (26 loc) · 705 Bytes
/
Dockerfile
File metadata and controls
27 lines (26 loc) · 705 Bytes
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
###############
# Build Stage #
###############
FROM hugomods/hugo:exts as builder
ARG GITHUB_TOKEN
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
ARG NETRC_USERNAME
ENV NETRC_USERNAME=${NETRC_USERNAME}
ARG NETRC_PASSWORD
ENV NETRC_PASSWORD=${NETRC_PASSWORD}
# Base URL
ARG HUGO_BASEURL=
ENV HUGO_BASEURL=${HUGO_BASEURL}
# Module Proxy
ARG HUGO_MODULE_PROXY=
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
# Build site
COPY . /src
RUN printf "machine github.com\nlogin $NETRC_USERNAME\npassword $NETRC_PASSWORD" >> $HOME/.netrc
RUN hugo --minify --gc --enableGitInfo
###############
# Final Stage #
###############
FROM hugomods/hugo:nginx
COPY deploy/nginx/conf.d /etc/nginx/conf.d/
COPY --from=builder /src/public /site