Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/make
  2. SHELL = /bin/sh
  3. USER_UID := $(shell id -u)
  4. USER_UNAME := $(shell id -un)
  5. USER_GID := $(shell id -g)
  6. USER_GNAME := $(shell id -gn)
  7. DATE_NOW := $(shell date '+%Y-%m-%d_%H%M%S')
  8. export USER_UID
  9. export USER_UNAME
  10. export USER_GID
  11. export USER_GNAME
  12. build:
  13. docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
  14. buildnc:
  15. docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
  16. buildncnginx:
  17. docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) nginx
  18. buildncnginx_static:
  19. docker-compose -f docker-compose-static.yml build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) nginx_static
  20. up:
  21. docker-compose up -d
  22. up_static:
  23. docker-compose -f docker-compose-static.yml up -d
  24. down_static:
  25. docker-compose -f docker-compose-static.yml down
  26. restart_nginx:
  27. docker-compose restart nginx
  28. restart_nginx_static:
  29. docker-compose -f docker-compose-static.yml restart nginx_static
  30. # upbuild:
  31. # docker-compose up -d --build
  32. ps:
  33. docker-compose ps
  34. logs:
  35. docker-compose logs -f
  36. down:
  37. docker-compose down
  38. exec_phpd7:
  39. docker exec -it clameurs-phpd7-1 bash
  40. exec_mysqld7:
  41. docker exec -it clameurs-mysqld7-1 bash
  42. exec_nginx:
  43. docker exec -it clameurs-nginx-1 bash
  44. exec_npm:
  45. docker exec -it clameurs-npm-1 sh
  46. dump_d7_db:
  47. docker exec clameurs-mysqld7-1 sh -c 'exec mysqldump -uroot -pperfart perfart' > ./ressources/perfart_d7-$(DATE_NOW)-local.sql