From 80b06f68c6bbf3f112fb40b21bb16aa0ff6730d9 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Thu, 6 Jun 2019 19:54:48 +0200 Subject: [PATCH] Add frontend build to Dockerfile --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2af5e11..2f7ea59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,9 @@ +FROM node:8-alpine AS ui +WORKDIR /build +COPY . . +RUN npm install --prefix=ui +RUN npm run --prefix=ui build + FROM golang:1.12 AS build WORKDIR /build RUN go get -u github.com/go-bindata/go-bindata/... &&\ @@ -6,7 +12,8 @@ COPY go.mod . COPY go.sum . RUN go mod download COPY . . -RUN go-bindata-assetfs -prefix html html html/img &&\ +COPY --from=ui /build/ui/public /build/ui/public +RUN go-bindata-assetfs -prefix ui/public ui/public &&\ go install . FROM gcr.io/distroless/base:latest