cluster-hostname.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. version: "3"
  2. services:
  3. nacos1:
  4. hostname: nacos1
  5. container_name: nacos1
  6. image: nacos/nacos-server:latest
  7. volumes:
  8. - ./cluster-logs/nacos1:/home/nacos/logs
  9. - ./init.d/custom.properties:/home/nacos/init.d/custom.properties
  10. ports:
  11. - "8848:8848"
  12. - "9555:9555"
  13. env_file:
  14. - ../env/nacos-hostname.env
  15. restart: always
  16. depends_on:
  17. - mysql
  18. nacos2:
  19. hostname: nacos2
  20. image: nacos/nacos-server:latest
  21. container_name: nacos2
  22. volumes:
  23. - ./cluster-logs/nacos2:/home/nacos/logs
  24. - ./init.d/custom.properties:/home/nacos/init.d/custom.properties
  25. ports:
  26. - "8849:8848"
  27. env_file:
  28. - ../env/nacos-hostname.env
  29. restart: always
  30. depends_on:
  31. - mysql
  32. nacos3:
  33. hostname: nacos3
  34. image: nacos/nacos-server:latest
  35. container_name: nacos3
  36. volumes:
  37. - ./cluster-logs/nacos3:/home/nacos/logs
  38. - ./init.d/custom.properties:/home/nacos/init.d/custom.properties
  39. ports:
  40. - "8850:8848"
  41. env_file:
  42. - ../env/nacos-hostname.env
  43. restart: always
  44. depends_on:
  45. - mysql
  46. mysql:
  47. container_name: mysql
  48. image: nacos/nacos-mysql:5.7
  49. env_file:
  50. - ../env/mysql.env
  51. volumes:
  52. - ./mysql:/var/lib/mysql
  53. ports:
  54. - "3306:3306"