website/Dockerfile.prod

30 lines
710 B
Docker
Raw Normal View History

2020-02-20 01:16:28 +00:00
# STEP 1: Build the website's files
FROM node:current-alpine AS build-website
WORKDIR /src
COPY . /src/
RUN cd /src && yarn && yarn build
# STEP 2: Get a binary for 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/dist /app/dist
# Copy over static-web-server
COPY --from=build-webserver /go/bin/static-web-server /app/
ENTRYPOINT ["./static-web-server", "-rootDir", "dist", "-port", "80", "-spa"]