website/Dockerfile.prod
jeff 9cc715bd92 BlogPost_BooleanNames (#22)
Blog post on boolean names.

Co-authored-by: steverusso <steverusso@protonmail.com>
2020-07-30 22:44:24 +00:00

35 lines
865 B
Docker

# STEP 1: Build the website's files
FROM alpine:latest AS build-website
WORKDIR /src
COPY . /src/
# Get hugo -- using the edge branch to get latest version
RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
RUN apk update && apk upgrade && \
apk add --no-cache hugo
RUN hugo --minify
# STEP 2: Build the static-web-server
FROM golang:alpine AS build-webserver
RUN apk update && apk upgrade && \
apk add --no-cache git
RUN go get -u git.simplesystems.tech/simplesystems/static-web-server
# STEP 3: Combine static files and binary on fresh alpine image
FROM alpine:latest
WORKDIR /app
# Copy over static website files
COPY --from=build-website /src/public /app/public
# Copy over static-web-server
COPY --from=build-webserver /go/bin/static-web-server /app/
ENTRYPOINT ["./static-web-server", "-rootDir", "public", "-port", "80"]