3
0
Fork 0

Add Dockerfile

master
Ambrose Chua 2018-09-07 15:11:20 +08:00
parent c909e38d38
commit 4f7bfaf359
2 changed files with 24 additions and 0 deletions

3
Caddyfile Normal file
View File

@ -0,0 +1,3 @@
:80 {
root /srv
}

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM node:10-alpine as build
RUN apk add --no-cache git=2.18.0-r0
ARG hugo_version=0.48
RUN curl --silent --show-error --fail --location -o /tmp/hugo.tar.gz \
https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/hugo_${hugo_version}_Linux-64bit.tar.gz
RUN tar -xf /tmp/hugo.tar.gz -C /tmp
RUN mv /tmp/hugo /usr/local/bin/hugo
WORKDIR /web
COPY . .
RUN yarn install
RUN yarn build
RUN hugo
FROM productionwentdown/caddy:0.11.0
COPY --from=build /web/public /srv
COPY Caddyfile /etc/Caddyfile