-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile-server
38 lines (29 loc) · 1.07 KB
/
Dockerfile-server
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
# This file was cloned from https://github.com/mengzyou/docker-hugo/blob/main/Dockerfile
# It was moved to this repo to protect against upstream version upgrades
# Dockerfile to serve hugo sites
# It reads the local directory as source files
# then lets you interactively develop at http://localhost:1313
# Usage:
# cd <sqlitebrowser-website-directory>
# Build container with: docker build -f Dockerfile-serve -t hugo-server .
# Run interactively: docker run -it --rm -p 1313:1313 -v $(pwd):/home/hugo/app hugo-server
# Base image
FROM alpine:latest
ENV VERSION=0.111.3 \
ARCH=linux-amd64
RUN apk add --no-cache tini \
&& adduser -D hugo \
&& mkdir -p /home/hugo/app \
&& chown -R hugo:hugo /home/hugo/app
# Install hugo binary
RUN set -x \
&& cd /tmp/ \
&& wget https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_${VERSION}_${ARCH}.tar.gz \
&& tar zxf hugo_${VERSION}_${ARCH}.tar.gz \
&& mv ./hugo /usr/local/bin/ \
&& rm -rf *
WORKDIR /home/hugo/app
USER hugo
EXPOSE 1313
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "hugo", "server", "--bind=0.0.0.0"]