deploy/README.md
args.json 中的版本号FastGPT 目录执行 pnpm run gen:deploy 即可比如要添加 example 服务:
init.mjs 的 Services Enum 中添加 fastgptExample: fastgpt-exampleargs.json 中添加 image 和 tag, 注意 args.json 的 key 值,要和 init.mjs 的 value 值一致。比如添加 exampleDB 向量库:
templates/vector 下面,例如 templates/vector/exampleDB.txt 内容可以参考其他 txt,注意缩进,image 名字也要替换成 ${{exampleDB.image}}:${{exampleDB:tag}}, service name 必须是 vectorDBargs.json 中添加 exampleDB 的配置vectorconst vector = {
// pg, milvus, ob ...
vector: {
db: '', // 空即可
config: `/
VECTOR_URL:vectordb://xxxxx
`, //注意 第一行反引号后面的 / 不能少(去除首个换行符); 左边的两个空格的缩进不能变,否则会语法错误
extra: `` // 额外的配置,可以看 ob 的那个,需要一个 config 字段引入 init.sql
}
}
{ // 这是个块作用域, 直接搜 read in Vectors
// read in Vectors
// pg, ob ....
const vectordb = fs.readFileSync(path.join(process.cwd(), 'templates', 'vector', 'vector.txt'));
vector.vector.db = String(vectordb);
}
fs.promises.writeFile(
path.join(process.cwd(), 'docker', 'cn', 'docker-compose.vector.yml'),
replace(template, 'cn', VectorEnum.vector)
),
fs.promises.writeFile(
path.join(process.cwd(), 'docker', 'global', 'docker-compose.zilliz.yml'),
replace(template, 'global', VectorEnum.vector)
),
& 标志一个锚点
x-share-config: &x-share-config 'I am the config content'
x-share-config-list: &x-share-config-list
key1: value
key2: value
* 引用一个锚点
some_other_example: *x-share-config-list