From 636a5de124add370bc6f3b001e5891f449204e73 Mon Sep 17 00:00:00 2001 From: Meutel Date: Thu, 12 Sep 2019 15:10:08 +0200 Subject: [PATCH] docker build minify CSS --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50d17d6..e4d8960 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ WORKDIR /go/src/meutel.net/meutel/go-bouquins COPY . . -RUN go get . - -RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o app . +RUN GO111MODULE=on go get . +RUN GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o app . +RUN curl -X POST -s --data-urlencode 'input@assets/css/bouquins.css' https://cssminifier.com/raw > assets/css/bouquins.min.css # deployment image FROM debian:stable-slim @@ -17,7 +17,7 @@ WORKDIR /root/ RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install ca-certificates && update-ca-certificates -f COPY --from=builder /go/src/meutel.net/meutel/go-bouquins/app . COPY templates/ ./templates/ -COPY assets/ ./assets/ +COPY --from=builder /go/src/meutel.net/meutel/go-bouquins/assets/ ./assets/ CMD [ "./app" ]