From 6def28852125b2bcb99f3c666c5da23553173714 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Dec 2019 12:17:54 +0000 Subject: [PATCH] Slightly better docker support So you can run yarn install in the docker container --- .gitignore | 1 + package.json | 3 +++ scripts/{dockerbuild.sh => indocker.sh} | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) rename scripts/{dockerbuild.sh => indocker.sh} (85%) diff --git a/.gitignore b/.gitignore index 776ab13..6038e93 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /packages /deploys /node_modules +/docker_node_modules /pkg/control diff --git a/package.json b/package.json index 89f2000..3f9f26c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ "start": "electron .", "lint": "eslint src/", "build": "yarn run setversion && electron-builder", + "indocker": "scripts/indocker.sh", + "docker:build": "yarn run indocker yarn run build", + "docker:install": "yarn run indocker yarn install", "clean": "rimraf webapp.asar dist packages deploys" }, "dependencies": { diff --git a/scripts/dockerbuild.sh b/scripts/indocker.sh similarity index 85% rename from scripts/dockerbuild.sh rename to scripts/indocker.sh index 19b22b9..7b2d908 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/indocker.sh @@ -6,7 +6,7 @@ docker run --rm -ti \ --env ELECTRON_CACHE="/root/.cache/electron" \ --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \ -v ${PWD}:/project \ - -v ${PWD##*/}-node-modules:/project/node_modules \ + -v ${PWD}/docker_node_modules:/project/node_modules \ -v ~/.cache/electron:/root/.cache/electron \ -v ~/.cache/electron-builder:/root/.cache/electron-builder \ - electronuserland/builder yarn run build + electronuserland/builder "$@"