Update Docker files to get hugo from packages.

This commit is contained in:
russoj88 2020-04-24 11:44:55 -07:00
parent dfa147ca19
commit c87972c65b
2 changed files with 12 additions and 8 deletions

View File

@ -1,11 +1,13 @@
FROM golang:alpine FROM alpine:latest
# This should be mounted with docker run command # This should be mounted with docker run command
WORKDIR /src WORKDIR /src
RUN cd /src
# Build and run hugo # Get hugo -- using the edge branch to get latest version
ENV GO111MODULE=on RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
RUN go get -u github.com/gohugoio/hugo@v0.69.0 RUN apk update && apk upgrade && \
apk add --no-cache hugo=0.69.1-r0
# Run the development server # Run the development server
ENTRYPOINT cd /src && hugo server --bind 0.0.0.0 ENTRYPOINT hugo server --bind 0.0.0.0

View File

@ -1,5 +1,5 @@
# STEP 1: Build the website's files # STEP 1: Build the website's files
FROM golang:alpine AS build-website FROM alpine:latest AS build-website
WORKDIR /src WORKDIR /src
@ -7,8 +7,10 @@ COPY . /src/
RUN cd /src RUN cd /src
ENV GO111MODULE=on # Get hugo -- using the edge branch to get latest version
RUN go get -u github.com/gohugoio/hugo@v0.69.0 RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
RUN apk update && apk upgrade && \
apk add --no-cache hugo=0.69.1-r0
RUN hugo --minify RUN hugo --minify