-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 691 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 691 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
FROM alpine:3.9 AS build
ARG VERSION=0.109.0
ADD https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_${VERSION}_Linux-64bit.tar.gz /hugo.tar.gz
RUN tar -zxvf hugo.tar.gz
RUN /hugo version
RUN apk add --no-cache git
COPY . /site
WORKDIR /site
WORKDIR /site/LiveSite
RUN /hugo --minify --gc --themesDir /site/themes
FROM nginx:1.15-alpine
WORKDIR /site
RUN sed -i '4i\ include /etc/nginx/conf.d/headers.inc;\n' /etc/nginx/conf.d/default.conf
COPY headers.inc /etc/nginx/conf.d/headers.inc
RUN chmod 0644 /etc/nginx/conf.d/headers.inc
RUN cat /etc/nginx/conf.d/default.conf
COPY --from=build /site/LiveSite/public /usr/share/nginx/html
WORKDIR /usr/share/nginx/html/