Skip to content

Commit

Permalink
add npm script to build and run nuclear:prod using docker (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel376 committed Feb 13, 2019
1 parent e6e7c47 commit d949b3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node

WORKDIR /usr/src/
COPY . nuclear

RUN apt-get update && apt-get install -y libnss3 libgtk-3-0 libx11-xcb1 libxss1 libasound2

WORKDIR nuclear
RUN npm install && npm run build:dist && npm run build:electron && npm run pack
RUN ls -a | grep -v release | xargs rm -rf || true

CMD ["./release/linux-unpacked/nuclear"]
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
"electron:dev": "webpack --progress --colors --config=webpack.config.electron.js && electron ./bundle.electron.js",
"electron:prod:linux": "npm run build:electron:linux && electron ./dist/bundle.electron.js",
"electron:prod": "npm run build:electron && electron ./dist/bundle.electron.js",
"electron:docker": "docker run --rm --net=host --env=\"DISPLAY\" --volume=\"$HOME/.Xauthority:/root/.Xauthority:rw\" --device /dev/snd nuclear",
"watch": "webpack-dev-server --inline --progress --env=dev",
"build:dist": "webpack --progress --colors --env=prod && cp loader.css dist",
"build:electron:linux": "webpack --progress --colors --env.LINUX=true --config=webpack.config.electron.prod.js",
"build:electron": "webpack --progress --colors --config=webpack.config.electron.prod.js",
"build:docker": "docker build -t nuclear .",
"test": "mocha --require babel-register --require babel-polyfill --require ignore-styles --timeout 10000 --prof",
"pack": "electron-builder --dir -c.extraMetadata.main=dist/bundle.electron.js",
"dist": "babel-node electron-builder -c.extraMetadata.main=dist/bundle.electron.js",
Expand Down

0 comments on commit d949b3d

Please sign in to comment.