-
-
Save Josh-Miller/1d4aece130bef5a7fb90c880e3e4fe86 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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