docker-compose.yaml 1.3 KB

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