Skip to content

Instantly share code, notes, and snippets.

@enko
Last active November 29, 2017 02:34
Show Gist options
  • Save enko/31be945ca47b0c481275e76a2b695714 to your computer and use it in GitHub Desktop.
Save enko/31be945ca47b0c481275e76a2b695714 to your computer and use it in GitHub Desktop.
docker and colors reproduction
test_runner:
build: .
command: npm run test-dashboard
volumes:
- .:/usr/src/app
test_runner:
build: .
command: npm run test
volumes:
- .:/usr/src/app
FROM node:6.6
# add node modules folder to path and set global node path
ENV NODE_PATH /opt/node_modules
ENV PATH /opt/node_modules/.bin:$PATH
# copy dependency file for npm into the container --> everytime (to update possible dependencies)
ADD package.json /opt/package.json
# rm old node_modules
RUN rm -rf /opt/node_modules
# locally install project dependencies int NODE_PATH (defined above)
RUN cd /opt && npm install
WORKDIR /usr/src/app
{
"scripts": {
"test-dashboard": "nodejs-dashboard mocha test.js",
"test": "mocha test.js"
},
"dependencies": {
"mocha": "^3.0.2",
"nodejs-dashboard": "^0.1.0"
}
}
describe('test',() => {
it('test', () => {
throw new Error('oh hai');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment