一、购买&安装 doge 服务
首先采购服务,后通过下面地址进行登录
https://doge.ryansu.tech/#/profile
1、Github地址
Github:https://github.com/suyuan32/doge
通过上面的地址进行安装 doge服务
2、获取doge token
点击 【我的】-【个人信息设置】 进入页面
在页面上点击 【复制令牌】
二、doge 获取镜像源
1、module
doge module list
如果登录失效则需要填入 token
2、doge deploy
通过 doge docker deploy
最终生成的路径在 /Users/lei.wang/.doge
doge docker deploy -a fms-tenant
(base) lei.wang@leiwangs-MacBook-Pro:~/Desktop/simple-admin-tenant|⇒ doge docker deploy -a apms-api
Please choose version:
0 - v0.0.5-1-g4e25917
1 - v0.4.0-a8de3f602b
2 - v0.0.4-b1176731
3 - v0.0.3-1-gcc620a0
4 - v0.0.2-1-g0e03508
5 - v0.0.1
Input the number:
0
Deploying v0.0.5-1-g4e25917 version..
Use China repository? y/n
y
Whether to expose the port to public? (Not recommend in production) y/n
y
Wrong input data, please try again
y
Whether to use local database? y/n
n
Choose the database (1 - postgres 2 - mysql):
2
Please enter the database address:
你得mysql地址
Please enter the database port:
63736
Input the database password:
mysql的密码
Please enter the database name:
数据库名字
Please enter the database's user name:
root
Successful
下载后记得上
/Users/lei.wang(你的用户名下)/.doge
路径(mac)去找
3、配置文件与docker-compose
3.1、ACR登录
docker login --username=你的账号 registry.cn-hangzhou.aliyuncs.com
你的密码
docker login --username=你的账号 registry.cn-beijing.aliyuncs.com
你的密码
3.2、合并docker-compose
以新增 apms 为例,将下面的yaml配置到docker-compose.yml
中
注意将 aliyun的ACR 改为 simple_admin_vip
这个路径
apms-api:
image: registry.cn-hangzhou.aliyuncs.com/simple_admin_vip/apms-api:你获取的版本号
container_name: ctra-tenant-apms-api
restart: always
ports:
- '1102:9108'
environment:
AUTH_SECRET: xxx
volumes:
- /home/ctra/ctra-core-tenant/apms-api:/app/etc
networks:
simple-admin:
aliases:
- ctra-tenant-apms-api
deploy:
resources:
limits:
cpus: "0.5"
memory: 500M
reservations:
cpus: "0.05"
memory: 200M
3.3、配置对应的路径的yaml
Name: Apms.api
Host: 0.0.0.0
Port: 9108
Timeout: 20000
Auth:
AccessSecret: # the same as core
AccessExpire: 259200
CROSConf:
Address: '*'
Log:
ServiceName: ApmsApiLogger
Mode: console
Path: /home/data/logs/Apms/api
Level: info
Compress: false
KeepDays: 7
StackCoolDownMillis: 100
DatabaseConf:
Type: mysql
Host: mysql地址
Port: 63736
DBName: 数据库名
Username: root
Password: 密码
MaxOpenConn: 100
SSLMode: disable
CacheTime: 5
RedisConf:
Host: redis账号
Type: node
Pass: 密码
Db: 4
I18nConf:
Dir:
CoreRpc:
Endpoints:
- ctra-tenant-core-rpc:1101
Enabled: true
CasbinDatabaseConf:
Type: mysql
Host: mysql地址
Port: 63736
DBName: 数据库名
Username: root
Password: 密码
MaxOpenConn: 100
SSLMode: disable
CacheTime: 5
ProjectConf:
SyncTime: 1 # 同步时间,单位分钟
Batch: 100 # 单次批处理数量
BatchTime: 1 # 批处理间隔时间,单位秒
SyncEnabled: true # 是否启用同步, 初始化数据库需设置为 false
ServiceName: Apms # 服务名称,用于 Apms 鉴权
CasbinConf:
ModelText: |
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = r.sub == p.sub && keyMatch2(r.obj,p.obj) && r.act == p.act