Created
April 10, 2017 01:50
-
-
Save osteele/42d7a1d628f3aee219011cea825a8283 to your computer and use it in GitHub Desktop.
Bash functions for working on an npm package from within Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d.exec () { | |
docker run \ | |
-v yarn_cache:/root/.cache/yarn \ | |
-v `pwd`:/app \ | |
-v signage_node_modules:/app/node_modules \ | |
-p 3000:3000 \ | |
-it \ | |
node \ | |
"$@" | |
} | |
d.bash () { | |
d.exec bash -c 'cd /app && bash --login' | |
} | |
d.yarn () { | |
d.exec bash -c "cd /app && yarn $@" | |
} | |
d.run () { | |
d.yarn start | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment