SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SHELL := /bin/bash
  2. .PHONY: docs
  3.  
  4. ## Docker images tools...
  5. build-dev:
  6.     echo "Building dev image as taisr:dev..."
  7.     docker build -t taisr:dev . --build-arg env=dev
  8.  
  9. build-prod:
  10.     echo "Building prod image as taisr:prod..."
  11.     docker build -t taisr:prod . --build-arg env=prod
  12.  
  13. cleanup-images:
  14.     docker image rm $$(docker images -f "label=project=taisr" -q)
  15.  
  16. ## Dev env tools
  17. dev:
  18.     @if [ -n "$$(docker images taisr:dev -q)" ] ; \
  19.     then \
  20.         echo "Docker image found. Running app..." ; \
  21.     else \
  22.         echo "Docker image not found. Building image with make build-dev first..." && \
  23.         make build-dev ; \
  24.     fi ;
  25.     @if [ -n "$$(docker ps -q -f name="taisr-dev")" ] ; then echo "Your app is already working. Kill it with make stop-dev first." && exit 1 ; fi
  26.     @docker run -d --rm --expose 80 -e APP_PORT=80 --name=taisr-dev -v "$(PWD)/src:/usr/src/app/src" -w "/usr/src/app/" taisr:dev "npm run app"
  27.     @echo You app is available under http://$$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' taisr-dev)
  28.  
  29. dev-compose:
  30.     @docker-compose up
  31.  
  32. stop-dev:
  33.     @echo "Stopping dev container..."
  34.     @docker kill taisr-dev
  35.  
  36. dev-logs:
  37.     @docker logs -f taisr-dev
  38.  
  39. show-dev-ip:
  40.     @echo "http://$$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' taisr-dev)"
  41.  
  42. # Misc
  43. docs:
  44.     jsdoc -r src/* -d docs/jsdoc
  45.     apidoc -i src/ -o docs/apidoc/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top