-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
35 lines (26 loc) · 773 Bytes
/
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
###############
# Build Stage #
###############
FROM hugomods/hugo:exts as builder
COPY . /src
ENV HUGO_ENV=production
# Base URL
ARG HUGO_BASEURL=
ENV HUGO_BASEURL=${HUGO_BASEURL}
# Module Proxy
ARG HUGO_MODULE_PROXY=
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
# NPM mirrors, such as https://registry.npmmirror.com
ARG NPM_CONFIG_REGISTRY=
ENV NPM_CONFIG_REGISTRY=${NPM_CONFIG_REGISTRY}
# Install dependencies
RUN npm ci
# Build site
RUN hugo --minify --gc --enableGitInfo
# Set the fallback 404 page if defaultContentLanguageInSubdir is enabled, please replace the `en` with your default language code.
# RUN cp ./public/en/404.html ./public/404.html
###############
# Final Stage #
###############
FROM hugomods/hugo:nginx
COPY --from=builder /src/public /site