env-docker
v1.0.1
Published
Run a docker command with environment variables populated via .env.
Downloads
17
Maintainers
Readme
env-docker
NOTE: YOU NO LONGER NEED THIS AS YOU CAN NOW PROVIDE YOUR
.env
FILE VIAdocker-compose.yml
WITHenv_file
. YOU THEN TYPEdocker-compose up
TO START YOUR APPLICATION.
Prepare a docker command with environment variables populated via
.env
.
$ npm install env-docker --save-dev
Available Commands
run
$ env-docker run -- --rm -ti $(basename $PWD)
This can be conveniently used via npm run-scripts
as depicted below:
"scripts": {
"docker:build": "docker build -t $npm_package_name .",
"docker:run": "eval $(env-docker run -- -p 3000:3000 --rm -ti $npm_package_name) || true",
"predocker:run": "npm run docker:build",
},
To re-build and run, just type the following:
$ npm run docker:run