0.0.2 • Published 9 years ago
ned-build-image v0.0.2
ned-build-image
Builds a docker image for running a node application developed with ned.
install
npm install ned-build-imagecli usage
ned-build-image <mode>API
buildImage(pathToApp, mode)
pathToApp: stringpath to node applicationmode: string'dev'build image taggedned-app-devfor development.'prod' build image taggednedapp-prodfor production.
Dockerfile
If there is a Dockerfile in the app root, it will be built and used as the base image. It must have the following installed:
- node >= 6
- npm
- python
- make
- g++
dev image
run
docker run -it --rm \
-v $PWD:/app \
--user $(id -u) \
ned-app-devCMD
- watches
./srcfor changes - lints app
- transpiles app
- runs app and tests
ned dev -ltwvolumes
/app
Mount the node application here. ./src will be transpiled and output to ./build when files in ./src change.
prod image
Contains the transpiled app under /app/build ready for execution.
run
docker run -it ned-app-prodCMD
The default command just executes the app.