Chatbot UI老外在用的gpt网页版 搭建方法分享!
高仿ChatGPT官网,中文还支持贼好,界面美观度间距还需要打磨。是老外做的吗?
环境部署
更新环境
apt update -y && apt upgrade -y && apt install -y curl wget sudo socat
安装 Docker
curl -fsSL https://get.docker.com | sh
curl -L "https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
部署GPT网页版
部署命令
docker run -d --name chatbot-ui -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 ghcr.io/mckaywrigley/chatbot-ui:main
xxxxxxxx 改成自己的API
已经有帐号了。获取自己的OPENAI的APIkey
https://platform.openai.com/account/api-keys
创建nginx目录结构
mkdir -p /home/nginx
touch /home/nginx/nginx.conf
mkdir -p /home/nginx/certs
申请证书
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --register-account -m xxxx@gmail.com
~/.acme.sh/acme.sh --issue -d gpt.kjlion.ga --standalone
下载证书
~/.acme.sh/acme.sh --installcert -d gpt.kjlion.ga --key-file /home/nginx/certs/gpt_key.pem --fullchain-file /home/nginx/certs/gpt_cert.pem
进入目录编辑文件
cd /home/nginx/ && nano nginx.conf
反向代理配置,代理指定IP加端口
events {
worker_connections 1024;
}
http {
client_max_body_size 1000m;
#上传限制参数1G以内文件可上传
server {
listen 80;
server_name gpt.kjlion.gq;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gpt.kjlion.gq;
ssl_certificate /etc/nginx/certs/gpt_cert.pem;
ssl_certificate_key /etc/nginx/certs/gpt_key.pem;
location / {
proxy_pass http://0.0.0.0: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;
}
location /websocket {
proxy_pass http://0.0.0.0:3000/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
}
部署容器
docker run -d --name nginx -p 80:80 -p 443:443 -v /home/nginx/nginx.conf:/etc/nginx/nginx.conf -v /home/nginx/certs:/etc/nginx/certs -v /home/nginx/html:/usr/share/nginx/html nginx:latest
查看运行状态
docker ps -a
开机自启动
docker update --restart=always nginx
docker update --restart=always chatbot-ui
Docker常用命令
https://kejilion.blogspot.com/2023/02/docker.html
原作者地址
https://github.com/mckaywrigley/chatbot-ui
评论
发表评论