From 17b7653109d243ae71189a2fa62a9ef0a6973fd0 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Tue, 21 Feb 2017 14:33:00 -0500 Subject: [PATCH] [dev, cloud-*] make Docker run plain npm install and conslidate deps Summary: It doesn't really make sense to have the root package.json have any dependencies since it's never "packaged" or built itself. Everything really should be a dev dependency. This was only separated before because the Dockerfile unnecessarily added the --production flag. This will make the docker build take a smidge longer, but I think it's worth the extra minute to keep the dependencies orderly and sematically correct Test Plan: re-run docker build Reviewers: jerm, spang, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D3978 --- Dockerfile | 2 +- package.json | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecea8f378..d496f179d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /home # bootstrap to install and link cloud-api, cloud-core, and cloud-workers. # We need the --unsafe-perm param to run the postinstall script since Docker # will run everything as sudo -RUN npm install --production --unsafe-perm +RUN npm install --unsafe-perm # This uses babel to compile any es6 to stock js for plain node RUN node packages/cloud-core/build/build-n1-cloud diff --git a/package.json b/package.json index f87285a32..f7fb0226c 100644 --- a/package.json +++ b/package.json @@ -2,21 +2,12 @@ "name": "nylas-mail-all", "version": "0.0.1", "description": "All components required to run Nylas Mail", - "dependencies": { + "devDependencies": { "babel-cli": "6.x.x", "babel-core": "6.x.x", "babel-eslint": "7.1.0", "babel-preset-electron": "1.4.15", "babel-preset-react": "6.x.x", - "pm2": "2.4.0", - "lerna": "2.0.0-beta.37", - "fs-plus": "2.x.x", - "fs-extra": "2.x.x", - "glob": "7.x.x", - "request": "2.x.x", - "underscore": "1.8.x" - }, - "devDependencies": { "chalk": "1.x.x", "coffeelint-cjsx": "2.x.x", "electron-installer-dmg": "0.2.x", @@ -27,6 +18,9 @@ "eslint-plugin-jsx-a11y": "2.2.3", "eslint-plugin-react": "6.7.1", "eslint_d": "4.2.0", + "fs-extra": "2.x.x", + "fs-plus": "2.x.x", + "glob": "7.x.x", "grunt": "0.4.x", "grunt-cli": "0.1.x", "grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe", @@ -36,8 +30,12 @@ "grunt-contrib-less": "0.8.x", "grunt-electron-installer": "2.x.x", "grunt-lesslint": "0.13.x", + "lerna": "2.0.0-beta.37", + "pm2": "2.4.0", + "request": "2.x.x", "s3": "4.x.x", - "temp": "0.8.x" + "temp": "0.8.x", + "underscore": "1.8.x" }, "scripts": { "start": "npm run start-client", @@ -54,7 +52,7 @@ "test-cloud": "", "stop": "npm run stop-cloud", "stop-cloud": "pm2 stop all; pm2 delete all;", - "build-cloud": "", + "build-cloud": "docker build .", "postinstall": "babel-node scripts/postinstall.js" },