68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
version: '3.7'
|
|
|
|
# 申明同一个网络
|
|
networks:
|
|
net:
|
|
name: net
|
|
|
|
# 游戏数据卷
|
|
volumes:
|
|
dreamfactory_consuldata:
|
|
name: dreamfactory_consuldata
|
|
dreamfactory_redisdata:
|
|
name: dreamfactory_redisdata
|
|
dreamfactory_mongodata:
|
|
name: dreamfactory_mongodata
|
|
# 服务
|
|
services:
|
|
redis:
|
|
image: redis:latest
|
|
container_name: dreamfactory_redis
|
|
ports:
|
|
- '10011:6379'
|
|
networks:
|
|
net:
|
|
# 给网络取别名,可以用redis和cache找到
|
|
aliases:
|
|
- cache
|
|
command: /etc/redis/redis.conf
|
|
volumes:
|
|
# 持久存储redis的数据
|
|
- dreamfactory_redisdata:/data
|
|
# 挂载本地配置文件
|
|
- ./redis.conf:/etc/redis/redis.conf
|
|
# 时间同步
|
|
# - /etc/localtime:/etc/localtime
|
|
consul:
|
|
image: consul:latest
|
|
container_name: dreamfactory_consul
|
|
ports:
|
|
- '10012:8500'
|
|
command: consul agent -server -bootstrap -data-dir /consul/data -node=ylconsul -bind=0.0.0.0 -config-dir=/consul/config/ -client=0.0.0.0 -ui
|
|
networks:
|
|
net:
|
|
# 给网络取别名,可以用consul和discovery找到
|
|
aliases:
|
|
- discovery
|
|
volumes:
|
|
- dreamfactory_consuldata:/consul/data
|
|
mongo:
|
|
image: mongo:latest
|
|
container_name: dreamfactory_mongo
|
|
ports:
|
|
- '10013:27017'
|
|
networks:
|
|
net:
|
|
# 给网络取别名,可以用mongodb和db找到
|
|
aliases:
|
|
- db
|
|
command: ['mongod', '-f', '/etc/mongo/mongod.conf']
|
|
# environment:
|
|
# MONGO_INITDB_ROOT_USERNAME: liwei1dao
|
|
# MONGO_INITDB_ROOT_PASSWORD: li13451234
|
|
volumes:
|
|
# 持久存储mongodb的数据
|
|
- dreamfactory_mongodata:/data/db:rw
|
|
- dreamfactory_mongodata:/data/configdb:rw
|
|
# 挂载本地配置文件
|
|
- ./mongod.conf:/etc/mongo/mongod.conf:rw |