From 908e23066a8b5bcd5ca224277e734aa8c0a248ef Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Mon, 10 Dec 2018 17:08:59 -0800 Subject: [PATCH] Fix frontend build --- Dockerfile | 15 +++++++-------- package.json | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 05381f8..17c8baf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,12 @@ -FROM node:latest AS gulp +FROM node:8-slim AS frontend_builder WORKDIR /app COPY . . RUN npm install -RUN npm link gulp -RUN gulp patch +RUN npm run build -FROM golang:1.11.2 AS build +FROM golang:1.11.2 AS backend_builder WORKDIR /podsync -COPY --from=gulp /app . +COPY --from=frontend_builder /app . ENV GOOS=linux ENV GOARCH=amd64 ENV CGO_ENABLED=0 @@ -16,9 +15,9 @@ RUN go build -o server -v ./cmd/app FROM alpine RUN apk --update --no-cache add ca-certificates WORKDIR /app/ -COPY --from=gulp /app/templates ./templates -COPY --from=gulp /app/dist ./assets -COPY --from=build /podsync/server . +COPY --from=frontend_builder /app/templates ./templates +COPY --from=frontend_builder /app/dist ./assets +COPY --from=backend_builder /podsync/server . ENV ASSETS_PATH /app/assets ENV TEMPLATES_PATH /app/templates ENTRYPOINT ["/app/server"] \ No newline at end of file diff --git a/package.json b/package.json index 62422ff..ad57d4c 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "gulp-uglify": "^3.0.0" }, "scripts": { + "build": "gulp -v && gulp patch", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": {