docker_app.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. ###############################################################################
  3. # 运行 docker 镜像
  4. ###############################################################################
  5. set -e
  6. function start() {
  7. docker run -d --name=tnbeureka --network=host -v /opt/log:/app/logs tnb/eureka
  8. docker run -d --name=tnbgateway --network=host -v /opt/log:/app/logs tnb/gateway
  9. docker run -d --name=tnbaccount --network=host -v /opt/log:/app/logs tnb/account
  10. docker run -d --name=tnbfile --network=host -v /opt/log:/app/logs tnb/file
  11. docker run -d --name=tnbuser --network=host -v /opt/log:/app/logs tnb/user
  12. docker run -d --name=tnbcontent --network=host -v /opt/log:/app/logs tnb/content
  13. docker run -d --name=tnbsearch --network=host -v /opt/log:/app/logs tnb/search
  14. docker run -d --name=tnbmessage --network=host \
  15. -e NODE_ADDRESS=127.0.0.1 \
  16. -v /opt/log:/app/logs \
  17. tnb/message
  18. docker run -d --name=tnboss --network=host \
  19. -v /opt/disk/1:/opt/disk/1 \
  20. tnb/oss-store
  21. docker run -d --name=tnbapp --network=host tnb/tnbapp
  22. }
  23. function shutdown() {
  24. docker stop tnbeureka && docker rm tnbeureka
  25. docker stop tnbgateway && docker rm tnbgateway
  26. docker stop tnbaccount && docker rm tnbaccount
  27. docker stop tnbmessage && docker rm tnbmessage
  28. docker stop tnbfile && docker rm tnbfile
  29. docker stop tnbuser && docker rm tnbuser
  30. docker stop tnbcontent && docker rm tnbcontent
  31. docker stop tnbsearch && docker rm tnbsearch
  32. docker stop tnboss && docker rm tnboss
  33. docker stop tnbapp && docker rm tnbapp
  34. }
  35. start
  36. #shutdown