From 376de340d6bf7c807a52b68a0135a8c970d22658 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Tue, 19 Feb 2019 16:01:31 +0100 Subject: [PATCH] :whale: :zap: Minify in production image --- frontend/Dockerfile | 7 ++++--- frontend/package.json | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 44c9bd322e..29fdc3c733 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,7 +1,8 @@ FROM monogramm/docker-uxbox-builder:latest -ENV API_URL=http://127.0.0.1:6060/api -ENV LEIN_ROOT=TRUE +ENV LEIN_ROOT=TRUE \ + API_URL=http://127.0.0.1:6060/api \ + IS_DEMO=false # Copy frontend source and build release COPY . /home/uxbox/frontend @@ -13,7 +14,7 @@ RUN set -ex; \ -e 's|"uxbox.config.url" ".*"|"uxbox.config.url" "${API_URL}/api"|g' \ scripts/figwheel.clj; \ npm install; \ - npm run dist; \ + npm run prod; \ bash -c "/home/uxbox/frontend/scripts/dist-main"; \ bash -c "/home/uxbox/frontend/scripts/dist-view"; \ bash -c "/home/uxbox/frontend/scripts/dist-worker" diff --git a/frontend/package.json b/frontend/package.json index 9ddc593ca6..5b123cad61 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,6 +11,7 @@ "scripts": { "watch": "gulp", "dist": "gulp dist", + "prod": "gulp dist --production", "clean": "gulp clean", "figwheel": "PATH=./scripts:$PATH ./scripts/build-worker && PATH=./scripts:$PATH ./scripts/figwheel", "test-watch": "PATH=./scripts:$PATH ./scripts/watch",