docker-compose.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. version: '3.8'
  2. # 网络
  3. networks:
  4. default:
  5. external:
  6. name: default-network
  7. # name: default-network
  8. services:
  9. #nginx反向代理
  10. box-nginx:
  11. image: "registry.cn-chengdu.aliyuncs.com/infish/pack-comm-nginx:1.23.1"
  12. restart: always
  13. ports:
  14. - 18088:80
  15. volumes:
  16. - ./nginx/conf.d:/etc/nginx/conf.d
  17. - ./nginx/www:/usr/share/nginx/html
  18. #bus消息中间件
  19. box-bus:
  20. restart: always
  21. image: registry.cn-chengdu.aliyuncs.com/infish/pack-box-bus:v1.0.0
  22. volumes:
  23. - ./config-service.yaml:/root/box-bus/app.yaml
  24. depends_on:
  25. - box-mongo
  26. - box-redis
  27. ports:
  28. - 14300:4222
  29. #redis缓存
  30. box-redis:
  31. image: "redis:alpine"
  32. restart: always
  33. command:
  34. --requirepass "boxcomm" #这一行是设置密码
  35. privileged: true
  36. ports:
  37. - 16390:6379
  38. #mongo 数据库
  39. box-mongo:
  40. image: mongo:4.4.1
  41. restart: always
  42. environment:
  43. MONGO_INITDB_ROOT_USERNAME: root
  44. MONGO_INITDB_ROOT_PASSWORD: boxcost
  45. volumes:
  46. - ~/data/packs-box/mongo/db:/data/db
  47. - ~/data/packs-box/mongo/log:/var/log/mongodb
  48. ports:
  49. - 37030:27017
  50. # cost 8888
  51. box-cost:
  52. image: registry.cn-chengdu.aliyuncs.com/infish/pack-box-cost:v1.0.0
  53. restart: always
  54. depends_on:
  55. - box-bus
  56. environment:
  57. NATS: nats://box-bus:4222
  58. # 用户中心 8908
  59. box-usercenter:
  60. image: registry.cn-chengdu.aliyuncs.com/infish/pack-box-usercenter:v1.0.0
  61. restart: always
  62. depends_on:
  63. - box-bus
  64. environment:
  65. NATS: nats://box-bus:4222