-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 851 Bytes
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 851 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
28
29
30
31
32
33
34
35
36
# builder image
FROM alpine:latest
ENV HUGO_VERSION 0.134.0
LABEL description="gohugo build"
LABEL version="1.0"
LABEL maintainer="jholdstock@decred.org"
WORKDIR /tmp
RUN apk update && apk upgrade
RUN apk add --no-cache bash wget libc6-compat g++
RUN wget -q https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz
RUN tar xz -C /usr/local/bin -f hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz
WORKDIR /root
COPY . /root/
# Remove old hugo output before building
RUN rm -rf public resources
# Build site
RUN hugo --buildFuture
# Serve image (stable nginx version)
FROM nginx:1.26
LABEL description="dcrblog server"
LABEL version="1.0"
LABEL maintainer="jholdstock@decred.org"
COPY conf/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=0 /root/public/ /usr/share/nginx/html