From d1b968ca2a87164021873d0d1a57b9833e63d330 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sun, 22 May 2022 12:56:56 -0400 Subject: [PATCH] Added Dockerfile to build a docker image for building the app --- Dockerfile | 23 +++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe39d98 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# This Dockerfile was created merely to build the app through CI. It might work +# for local builds, but is not guaranteed. + +# build the app with Node.js version 16 +FROM node:16 + +# set working directory of the build +WORKDIR /usr/src/app + +# install dependencies +RUN apt update && \ + apt install -y ruby ruby-dev rpm \ + gem install sass + +# make sure node_modules and public exist so we can ensure it's own by the right user +RUN mkdir /usr/src/app/{node_modules,public} + +RUN chown -R node /usr/src/app + +USER node + +VOLUME /usr/src/app/node_modules +VOLUME /usr/src/app/public diff --git a/package.json b/package.json index 49be3a8..a039d3f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "main.js", "scripts": { "start": "electron .", - "build": "electron-builder build --win --linux", + "build-linux": "electron-builder build --linux", + "build-win": "electron-builder build --win", "grunt": "grunt" }, "repository": "https://github.com/electron/electron-quick-start",