Skip to content

Commit

Permalink
add NPM_OPTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
ffaerber committed Nov 30, 2017
1 parent f5201ac commit 5cded27
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG QEMU
ARG NPM_OPTIONS
ARG BASE_IMAGE=amd64/debian:stretch-slim
FROM ${BASE_IMAGE}

Expand All @@ -19,9 +20,7 @@ WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/

RUN npm install standard --global
RUN npm install nodemon --global
RUN npm install
RUN npm install ${NPM_OPTIONS}

# Bundle app source
COPY . /usr/src/app
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
npm_install:
npm_reinstall:
docker-compose down
docker volume rm appsample_node_modules
docker-compose up --build
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "simple-api",
"name": "appsample",
"version": "1.0.0",
"description": "simple api test",
"description": "example application",
"main": "index.js",
"scripts": {
"test": "nodemon -L --exec 'standard --fix && jest --forceExit'"
"test": "node_modules/.bin/nodemon -L --exec 'node_modules/.bin/standard --fix && jest --forceExit'"
},
"author": "Felix Faerber",
"license": "MIT",
Expand All @@ -20,6 +20,8 @@
},
"devDependencies": {
"jest": "21.2.1",
"nodemon": "1.12.0",
"standard": "10.0.3",
"supertest": "3.0.0"
}
}
7 changes: 6 additions & 1 deletion travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ if [ -d tmp ]; then
rm -rf tmp
fi

docker build -t appsample --build-arg BASE_IMAGE=$BASE_IMAGE --build-arg QEMU=$QEMU .
docker build -t appsample \
--build-arg BASE_IMAGE=$BASE_IMAGE \
--build-arg QEMU=$QEMU \
--build-arg NPM_OPTIONS=--production \
.

docker run appsample uname -a

0 comments on commit 5cded27

Please sign in to comment.