From 096c58f21765c45aeac7654761d93ca2f283bef9 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Tue, 9 Feb 2016 07:44:44 +0100 Subject: [PATCH] fix build error with npm --- Dockerfile | 15 +++++++++------ README.md | 6 +++--- package.json | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e18227..1dde06c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ FROM node:argon -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app +RUN mkdir -p /src +WORKDIR /src -ONBUILD COPY package.json /usr/src/app/ -ONBUILD RUN npm install -ONBUILD COPY . /usr/src/app +COPY package.json /src/ +RUN npm install -CMD [ "npm", "start" ] \ No newline at end of file +COPY . /src +RUN npm run build + +EXPOSE 8080 +CMD [ "npm", "start" ] diff --git a/README.md b/README.md index bcd1e9c..b44bba1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ lesspass is like keepass without the need to persist passwords * node v4.2.x LTS -## try lesspass +## try lesspass on local clone application: @@ -37,6 +37,6 @@ run test in watch mode npm run test:watch -## build for production +## run production mode - npm start \ No newline at end of file + npm run build && npm start \ No newline at end of file diff --git a/package.json b/package.json index a19a161..e254fbc 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "scripts": { "test": "mocha --compilers js:babel-core/register tests", "test:watch": "npm run test -- -w", - "prestart": "npm install", + "predev": "npm install", "dev": "webpack-dev-server --inline --hot --host 0.0.0.0", - "prebuild": "rimraf dist && npm prune", + "prebuild": "rimraf dist && npm prune && npm install", "build": "NODE_ENV=production webpack --progress --hide-modules", - "start": "npm run build && NODE_ENV=production node server.js" + "start": "NODE_ENV=production node server.js" }, "repository": { "type": "git",