Skip to content

Instantly share code, notes, and snippets.

@gabesullice
Last active April 1, 2016 17:49
Show Gist options
  • Save gabesullice/991c58c8f4b292d555850894485b53b5 to your computer and use it in GitHub Desktop.
Save gabesullice/991c58c8f4b292d555850894485b53b5 to your computer and use it in GitHub Desktop.
build:
docker build -t node-portal .
stopdev:
- docker kill node-portal
- docker rm node-portal
startdev:
docker run \
-v $(shell pwd)/app/src:/var/node/app/src \
-v $(shell pwd)/app/public:/var/node/app/public \
-v $(shell pwd)/app/index.js:/var/node/app/index.js \
-d --name node-portal \
-p 8000:8000 \
node-portal
watch: .watch
while true; do sleep .5; make -s checksum; done;
checksum:
cat `find . -type f ! -path *./.git* ! -name .watch` | base64 | md5sum --status -c .watch || make -s reload
reload: .watch
printf "Change detected. Reloading node-portal...\n"
- docker kill node-portal >/dev/null
- docker start node-portal >/dev/null && printf "Reloaded.\n" || printf "Reload failed."
.watch:
cat `find . -type f ! -path *./.git* ! -name .watch` | base64 | md5sum > .watch
.PHONY: build stopdev startdev watch checksum reload .watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment