version: '3.8' # 网络 networks: default: name: default-network external: true services: #nginx反向代理 oilseal-train-nginx: image: "registry.cn-chengdu.aliyuncs.com/infish/pack-comm-nginx:1.23.1" restart: always ports: - 18090:80 volumes: - ./nginx/conf.d:/etc/nginx/conf.d - ./nginx/www:/usr/share/nginx/html depends_on: - oilseal-train - oilseal-train-user #bus消息中间件 oilseal-train-bus: restart: always image: registry.cn-chengdu.aliyuncs.com/infish/pack-comm-bus:v1.0.0 volumes: - ./config-service.yaml:/root/bus/app.yaml depends_on: - oilseal-train-mongo - oilseal-train-redis ports: - 14302:4222 #redis缓存 oilseal-train-redis: image: "redis:alpine" restart: always command: --requirepass "oilseal-train" #这一行是设置密码 privileged: true ports: - 16392:6379 #mongo 数据库 oilseal-train-mongo: image: mongo:4.4.1 restart: always environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: oilseal-train volumes: - ~/data/packs-oilseal-train/mongo/db:/data/db - ~/data/packs-oilseal-train/mongo/log:/var/log/mongodb ports: - 37032:27017 # oilseal-train oilseal-train: image: registry.cn-chengdu.aliyuncs.com/infish/pack-oilseal-train:v1.0.0 restart: always depends_on: - oilseal-train-bus environment: NATS: nats://oilseal-train-bus:4222 MONGO_MIGRATIONS: /data/migrations==mongodb://root:oilseal-train@oilseal-train-mongo:27017/oilseal-train?authSource=admin volumes: - ./mongo-migrations:/data/migrations