上传docker 环境文件
This commit is contained in:
parent
fdd76334da
commit
93278a51c0
68
bin/docker_dreamfactory/docker-compose.yml
Normal file
68
bin/docker_dreamfactory/docker-compose.yml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
# 申明同一个网络
|
||||||
|
networks:
|
||||||
|
net:
|
||||||
|
name: net
|
||||||
|
|
||||||
|
# 游戏数据卷
|
||||||
|
volumes:
|
||||||
|
consuldata:
|
||||||
|
name: consuldata
|
||||||
|
redisdata:
|
||||||
|
name: redisdata
|
||||||
|
mongodata:
|
||||||
|
name: mongodata
|
||||||
|
# 服务
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:latest
|
||||||
|
container_name: redis
|
||||||
|
ports:
|
||||||
|
- '10011:6379'
|
||||||
|
networks:
|
||||||
|
net:
|
||||||
|
# 给网络取别名,可以用redis和cache找到
|
||||||
|
aliases:
|
||||||
|
- cache
|
||||||
|
command: /etc/redis/redis.conf
|
||||||
|
volumes:
|
||||||
|
# 持久存储redis的数据
|
||||||
|
- redisdata:/data
|
||||||
|
# 挂载本地配置文件
|
||||||
|
- ./redis.conf:/etc/redis/redis.conf
|
||||||
|
# 时间同步
|
||||||
|
# - /etc/localtime:/etc/localtime
|
||||||
|
consul:
|
||||||
|
image: consul:latest
|
||||||
|
container_name: 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:
|
||||||
|
- consuldata:/consul/data
|
||||||
|
mongo:
|
||||||
|
image: mongo:latest
|
||||||
|
container_name: 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的数据
|
||||||
|
- mongodata:/data/db:rw
|
||||||
|
- mongodata:/data/configdb:rw
|
||||||
|
# 挂载本地配置文件
|
||||||
|
- ./mongod.conf:/etc/mongo/mongod.conf:rw
|
48
bin/docker_dreamfactory/mongod.conf
Normal file
48
bin/docker_dreamfactory/mongod.conf
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# mongod.conf
|
||||||
|
|
||||||
|
# for documentation of all options, see:
|
||||||
|
# http://docs.mongodb.org/manual/reference/configuration-options/
|
||||||
|
|
||||||
|
# where to write logging data.
|
||||||
|
# systemLog:
|
||||||
|
# destination: file
|
||||||
|
# logAppend: true
|
||||||
|
# path: "/var/log/mongodb/mongod.log"
|
||||||
|
|
||||||
|
# Where and how to store data.
|
||||||
|
storage:
|
||||||
|
dbPath: /data/db
|
||||||
|
journal:
|
||||||
|
enabled: true
|
||||||
|
wiredTiger:
|
||||||
|
engineConfig:
|
||||||
|
cacheSizeGB: 0.256
|
||||||
|
# engine:
|
||||||
|
# mmapv1:
|
||||||
|
# wiredTiger:
|
||||||
|
|
||||||
|
# how the process runs
|
||||||
|
# processManagement:
|
||||||
|
# fork: false # fork and run in background
|
||||||
|
# pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
|
||||||
|
# timeZoneInfo: /usr/share/zoneinfo
|
||||||
|
|
||||||
|
# network interfaces
|
||||||
|
net:
|
||||||
|
port: 27017
|
||||||
|
bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
|
||||||
|
|
||||||
|
|
||||||
|
#security:
|
||||||
|
|
||||||
|
#operationProfiling:
|
||||||
|
|
||||||
|
#replication:
|
||||||
|
|
||||||
|
#sharding:
|
||||||
|
|
||||||
|
## Enterprise-Only Options
|
||||||
|
|
||||||
|
#auditLog:
|
||||||
|
|
||||||
|
#snmp:
|
37
bin/docker_dreamfactory/nats.conf
Normal file
37
bin/docker_dreamfactory/nats.conf
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Client port of 4222 on all interfaces
|
||||||
|
port: 4222
|
||||||
|
|
||||||
|
# HTTP monitoring port
|
||||||
|
monitor_port: 8222
|
||||||
|
|
||||||
|
# This is for clustering multiple servers together.
|
||||||
|
cluster {
|
||||||
|
|
||||||
|
# Route connections to be received on any interface on port 6222
|
||||||
|
port: 6222
|
||||||
|
|
||||||
|
# Routes are protected, so need to use them with --routes flag
|
||||||
|
# e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
|
||||||
|
# authorization {
|
||||||
|
# user: ruser
|
||||||
|
# password: T0pS3cr3t
|
||||||
|
# timeout: 0.75
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Routes are actively solicited and connected to from this server.
|
||||||
|
# This Docker image has none by default, but you can pass a
|
||||||
|
# flag to the nats-server docker image to create one to an existing server.
|
||||||
|
routes = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# max_connections
|
||||||
|
max_connections: 100
|
||||||
|
|
||||||
|
# max_subscriptions (per connection)
|
||||||
|
max_subscriptions: 1000
|
||||||
|
|
||||||
|
# maximum protocol control line
|
||||||
|
max_control_line: 512
|
||||||
|
|
||||||
|
# maximum payload
|
||||||
|
max_payload: 65536
|
63
bin/docker_dreamfactory/nginx.conf
Normal file
63
bin/docker_dreamfactory/nginx.conf
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
user nginx;
|
||||||
|
worker_processes 2;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 4096;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 120;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
#(配置请求体缓存区大小, 不配的话)
|
||||||
|
}
|
||||||
|
|
||||||
|
stream {
|
||||||
|
# redisd 代理
|
||||||
|
upstream redis {
|
||||||
|
hash $remote_addr consistent;
|
||||||
|
server redis:6379 weight=5 max_fails=1 fail_timeout=10s;
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 10001;
|
||||||
|
proxy_pass redis;
|
||||||
|
}
|
||||||
|
# redisd 代理
|
||||||
|
upstream mongo {
|
||||||
|
hash $remote_addr consistent;
|
||||||
|
server mongo:27017 weight=5 max_fails=1 fail_timeout=10s;
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 10002;
|
||||||
|
proxy_pass mongo;
|
||||||
|
}
|
||||||
|
# consul 代理
|
||||||
|
upstream consul {
|
||||||
|
hash $remote_addr consistent;
|
||||||
|
server consul:8500 weight=5 max_fails=1 fail_timeout=10s;
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 10003;
|
||||||
|
proxy_pass consul;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
1378
bin/docker_dreamfactory/redis.conf
Normal file
1378
bin/docker_dreamfactory/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
6
linux_bulid.sh
Normal file
6
linux_bulid.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
CGO_ENABLED=0
|
||||||
|
GO111MODULE=on
|
||||||
|
GOOS=linux
|
||||||
|
go build -o ./bin/dbservice ./services/dbservice/main.go
|
||||||
|
go build -o ./bin/gateway ./services/gateway/main.go
|
||||||
|
go build -o ./bin/worker ./services/worker/main.go
|
Loading…
Reference in New Issue
Block a user