From 7d638c655c825596702dd599a75f5a4e5b7fb74d Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 8 Nov 2020 12:16:48 +0100 Subject: [PATCH] Add parcel build steps to docker --- .dockerignore | 5 ++++- Dockerfile | 6 +++--- docker/tmpl.Dockerfile | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index e7f5db5db..2832f5cb3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,6 +5,9 @@ *.sh *.yaml Dockerfile +.cache +dist +node_modules !entrypoint.sh -!modules/** !evcc.dist.yaml +!package*.json diff --git a/Dockerfile b/Dockerfile index 72b4bba3c..9a88cc83b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM golang:1.14-alpine as builder # Install git + SSL ca certificates. # Git is required for fetching the dependencies. # Ca-certificates is required to call HTTPS endpoints. -RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk && update-ca-certificates +RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk npm && update-ca-certificates WORKDIR /build @@ -17,8 +17,8 @@ COPY go.sum . RUN go mod download COPY . . -RUN make clean install assets -RUN AUDI_HASH_SECRET={{ env "AUDI_HASH_SECRET" }} make build +RUN make clean install ui assets +RUN make build # # STEP 2 build a small image including module support diff --git a/docker/tmpl.Dockerfile b/docker/tmpl.Dockerfile index 753e07900..af5a22762 100644 --- a/docker/tmpl.Dockerfile +++ b/docker/tmpl.Dockerfile @@ -6,7 +6,7 @@ FROM golang:1.14-alpine as builder # Install git + SSL ca certificates. # Git is required for fetching the dependencies. # Ca-certificates is required to call HTTPS endpoints. -RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk && update-ca-certificates +RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk npm && update-ca-certificates WORKDIR /build @@ -16,8 +16,8 @@ COPY go.sum . RUN go mod download COPY . . -RUN make clean install assets -RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} AUDI_HASH_SECRET={{ env "AUDI_HASH_SECRET" }} make build +RUN make clean install ui assets +RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} make build ############################# ## STEP 2 build a small image