cluster-ip.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. version: "2"
  2. services:
  3. nacos1:
  4. image: nacos/nacos-server:latest
  5. container_name: nacos1
  6. networks:
  7. nacos_net:
  8. ipv4_address: 172.16.238.10
  9. volumes:
  10. - ./cluster-logs/nacos1:/home/nacos/logs
  11. ports:
  12. - "8848:8848"
  13. - "9555:9555"
  14. env_file:
  15. - ../env/nacos-ip.env
  16. restart: on-failure
  17. depends_on:
  18. - mysql
  19. nacos2:
  20. image: nacos/nacos-server:latest
  21. container_name: nacos2
  22. networks:
  23. nacos_net:
  24. ipv4_address: 172.16.238.11
  25. volumes:
  26. - ./cluster-logs/nacos2:/home/nacos/logs
  27. ports:
  28. - "8849:8848"
  29. env_file:
  30. - ../env/nacos-ip.env
  31. restart: always
  32. depends_on:
  33. - mysql
  34. nacos3:
  35. image: nacos/nacos-server:latest
  36. container_name: nacos3
  37. networks:
  38. nacos_net:
  39. ipv4_address: 172.16.238.12
  40. volumes:
  41. - ./cluster-logs/nacos2:/home/nacos/logs
  42. ports:
  43. - "8850:8848"
  44. env_file:
  45. - ../env/nacos-ip.env
  46. restart: always
  47. depends_on:
  48. - mysql
  49. mysql:
  50. container_name: mysql
  51. image: nacos/nacos-mysql:5.7
  52. networks:
  53. nacos_net:
  54. ipv4_address: 172.16.238.13
  55. env_file:
  56. - ../env/mysql.env
  57. volumes:
  58. - ./mysql:/var/lib/mysql
  59. ports:
  60. - "3306:3306"
  61. networks:
  62. nacos_net:
  63. driver: bridge
  64. ipam:
  65. driver: default
  66. config:
  67. - subnet: 172.16.238.0/24