mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 17:55:24 +00:00
deploy file
This commit is contained in:
@@ -83,7 +83,7 @@ docker-compose -v
|
|||||||
|
|
||||||
#### 2. 创建 3 个初始化文件
|
#### 2. 创建 3 个初始化文件
|
||||||
|
|
||||||
手动创建或者直接把 deploy 里内容复制过去
|
手动创建或者直接把 deploy 里内容复制过去,然后把 deploy 文件夹改名为: fastgpt
|
||||||
|
|
||||||
**/root/fastgpt/pg/init.sql PG 数据库初始化**
|
**/root/fastgpt/pg/init.sql PG 数据库初始化**
|
||||||
|
|
||||||
|
@@ -6,26 +6,35 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
container_name: fast-gpt
|
container_name: fast-gpt
|
||||||
environment:
|
environment:
|
||||||
# - AXIOS_PROXY_HOST=127.0.0.1
|
# proxy(可选)
|
||||||
# - AXIOS_PROXY_PORT=7890
|
- AXIOS_PROXY_HOST=127.0.0.1
|
||||||
# - OPENAI_BASE_URL=https://api.openai.com/v1
|
- AXIOS_PROXY_PORT=7890
|
||||||
# - OPENAI_BASE_URL_AUTH=可选的安全凭证
|
# openai 中转连接(可选)
|
||||||
|
- OPENAI_BASE_URL=https://api.openai.com/v1
|
||||||
|
- OPENAI_BASE_URL_AUTH=可选的安全凭证
|
||||||
|
# 是否开启队列任务。 1-开启,0-关闭(请求 parentUrl 去执行任务,单机时直接填1)
|
||||||
|
- queueTask=1
|
||||||
|
- parentUrl=https://hostname/api/openapi/startEvents
|
||||||
|
# 发送邮箱验证码配置。用的是QQ邮箱。参考 nodeMail 获取MAILE_CODE,自行百度。
|
||||||
- MY_MAIL=xxxx@qq.com
|
- MY_MAIL=xxxx@qq.com
|
||||||
- MAILE_CODE=xxxx
|
- MAILE_CODE=xxxx
|
||||||
|
# 阿里短信服务(邮箱和短信至少二选一)
|
||||||
- aliAccessKeyId=xxxx
|
- aliAccessKeyId=xxxx
|
||||||
- aliAccessKeySecret=xxxx
|
- aliAccessKeySecret=xxxx
|
||||||
- aliSignName=xxxxx
|
- aliSignName=xxxxx
|
||||||
- aliTemplateCode=SMS_xxxx
|
- aliTemplateCode=SMS_xxxx
|
||||||
|
# token加密凭证(随便填,作为登录凭证)
|
||||||
- TOKEN_KEY=xxxx
|
- TOKEN_KEY=xxxx
|
||||||
- queueTask=1
|
# 和下方mongo镜像的username,password对应
|
||||||
- parentUrl=https://hostname/api/openapi/startEvents
|
|
||||||
- MONGODB_URI=mongodb://username:passsword@0.0.0.0:27017/?authSource=admin
|
- MONGODB_URI=mongodb://username:passsword@0.0.0.0:27017/?authSource=admin
|
||||||
- MONGODB_NAME=xxx
|
- MONGODB_NAME=xxx
|
||||||
- PG_HOST=0.0.0.0
|
- PG_HOST=0.0.0.0
|
||||||
- PG_PORT=8100
|
- PG_PORT=8100
|
||||||
- PG_USER=xxx
|
# 和下方PG镜像对应.
|
||||||
- PG_PASSWORD=xxx
|
- PG_USER=fastgpt # POSTGRES_USER
|
||||||
- PG_DB_NAME=xxx
|
- PG_PASSWORD=1234 # POSTGRES_PASSWORD
|
||||||
|
- PG_DB_NAME=fastgpt # POSTGRES_DB
|
||||||
|
# openai api key
|
||||||
- OPENAIKEY=sk-xxxxx
|
- OPENAIKEY=sk-xxxxx
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine3.17
|
image: nginx:alpine3.17
|
||||||
@@ -33,10 +42,12 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
volumes:
|
||||||
- /root/fast-gpt/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
# 刚创建的文件
|
||||||
- /root/fast-gpt/nginx/logs:/var/log/nginx
|
- /root/fastgpt/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
- /root/fast-gpt/nginx/ssl/docgpt.key:/ssl/docgpt.key
|
- /root/fastgpt/nginx/logs:/var/log/nginx
|
||||||
- /root/fast-gpt/nginx/ssl/docgpt.pem:/ssl/docgpt.pem
|
# https证书,没有的话不填,对应的nginx.conf也要修改
|
||||||
|
- /root/fastgpt/nginx/ssl/docgpt.key:/ssl/docgpt.key
|
||||||
|
- /root/fastgpt/nginx/ssl/docgpt.pem:/ssl/docgpt.pem
|
||||||
pg:
|
pg:
|
||||||
image: ankane/pgvector
|
image: ankane/pgvector
|
||||||
container_name: pg
|
container_name: pg
|
||||||
@@ -44,12 +55,14 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8100:5432
|
- 8100:5432
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=xxx
|
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||||
- POSTGRES_PASSWORD=xxx
|
- POSTGRES_USER=fastgpt
|
||||||
- POSTGRES_DB=xxx
|
- POSTGRES_PASSWORD=1234
|
||||||
|
- POSTGRES_DB=fastgpt
|
||||||
volumes:
|
volumes:
|
||||||
- /root/fast-gpt/pg/data:/var/lib/postgresql/data
|
# 刚创建的文件
|
||||||
- /root/fast-gpt/pg/init.sql:/docker-entrypoint-initdb.d/init.sh
|
- /root/fastgpt/pg/init.sql:/docker-entrypoint-initdb.d/init.sh
|
||||||
|
- /root/fastgpt/pg/data:/var/lib/postgresql/data
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:6.0.4
|
image: mongo:6.0.4
|
||||||
@@ -58,9 +71,10 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 27017:27017
|
||||||
environment:
|
environment:
|
||||||
|
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||||
- MONGO_INITDB_ROOT_USERNAME=username
|
- MONGO_INITDB_ROOT_USERNAME=username
|
||||||
- MONGO_INITDB_ROOT_PASSWORD=password
|
- MONGO_INITDB_ROOT_PASSWORD=password
|
||||||
volumes:
|
volumes:
|
||||||
- /root/fast-gpt/mongo/data:/data/db
|
- /root/fastgpt/mongo/data:/data/db
|
||||||
- /root/fast-gpt/mongo/logs:/var/log/mongodb
|
- /root/fastgpt/mongo/logs:/var/log/mongodb
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
@@ -54,4 +54,16 @@ http {
|
|||||||
server_name docgpt.ahapocket.cn;
|
server_name docgpt.ahapocket.cn;
|
||||||
rewrite ^(.*) https://$server_name$1 permanent;
|
rewrite ^(.*) https://$server_name$1 permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 3000;
|
||||||
|
server_name 120.0.0.0;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:3000;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user