docker-compose.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. version: '3'
  2. services:
  3. nacos:
  4. image: nacos/nacos-server:v2.2.1
  5. ports:
  6. - '8848:8848'
  7. - '9848:9848'
  8. container_name: nacos
  9. environment:
  10. - MODE=standalone
  11. - PREFER_HOST_MODE=hostname
  12. - SPRING_DATASOURCE_PLATFORM=mysql
  13. hostname: nacos
  14. networks:
  15. iot:
  16. aliases:
  17. - nacos
  18. mysql:
  19. image: mysql:latest
  20. ports:
  21. - '3306:3306'
  22. - '33060:33060'
  23. container_name: mysql
  24. environment:
  25. - MYSQL_ROOT_PASSWORD=xucaiqin
  26. hostname: mysql
  27. volumes:
  28. - mysql:/var/lib/mysql
  29. networks:
  30. iot:
  31. aliases:
  32. - mysql
  33. redis:
  34. image: redis:7.0-alpine
  35. ports:
  36. - '6379:6379'
  37. container_name: redis
  38. command:
  39. - redis-server --requirepass xucaiqin
  40. hostname: redis
  41. networks:
  42. iot:
  43. aliases:
  44. - redis
  45. gateway:
  46. build:
  47. context: ./iot-gateway
  48. dockerfile: ./Dockerfile
  49. container_name: iot-gateway
  50. ports:
  51. - '9000:9000'
  52. environment:
  53. - PROFILES=local
  54. hostname: iot-gateway
  55. networks:
  56. iot:
  57. aliases:
  58. - iot-gateway
  59. system:
  60. build:
  61. context: ./iot-module/iot-module-system
  62. dockerfile: ./Dockerfile
  63. container_name: iot-system
  64. ports:
  65. - '9002:9002'
  66. environment:
  67. - PROFILES=local
  68. hostname: iot-system
  69. networks:
  70. iot:
  71. aliases:
  72. - iot-system
  73. auth:
  74. build:
  75. context: ./iot-module/iot-module-auth
  76. dockerfile: ./Dockerfile
  77. container_name: iot-auth
  78. ports:
  79. - '9001:9001'
  80. environment:
  81. - PROFILES=local
  82. hostname: iot-auth
  83. networks:
  84. iot:
  85. aliases:
  86. - iot-auth
  87. manage:
  88. build:
  89. context: ./iot-module/iot-module-manage
  90. dockerfile: ./Dockerfile
  91. container_name: iot-manage
  92. ports:
  93. - '9003:9003'
  94. environment:
  95. - PROFILES=local
  96. hostname: iot-manage
  97. networks:
  98. iot:
  99. aliases:
  100. - iot-manage
  101. data:
  102. build:
  103. context: ./iot-module/iot-module-data
  104. dockerfile: ./Dockerfile
  105. container_name: iot-data
  106. ports:
  107. - '9004:9004'
  108. environment:
  109. - PROFILES=local
  110. hostname: iot-data
  111. networks:
  112. iot:
  113. aliases:
  114. - iot-data
  115. networks:
  116. iot:
  117. driver: bridge
  118. volumes:
  119. mysql: