Skip to content

Instantly share code, notes, and snippets.

@jjasonclark
Forked from enko/Dockerfile
Created November 29, 2017 02:34
Show Gist options
  • Save jjasonclark/0afed89466db871a3479f55ca2534439 to your computer and use it in GitHub Desktop.
Save jjasonclark/0afed89466db871a3479f55ca2534439 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
environment:
LANG: en_US.UTF-8
FORCE_COLOR: 'true'
test_runner:
build: .
command: npm run test
volumes:
- .:/usr/src/app
environment:
LANG: en_US.UTF-8
FORCE_COLOR: 'true'
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