目 录CONTENT

文章目录

【基于docker搭建】Chat GPT免费搭建

geekrabbit
2023-07-23 / 0 评论 / 0 点赞 / 1,007 阅读 / 799 字 / 正在检测是否收录...
温馨提示:
创作不易,转载请注明出处

准备工具如下

  1. 申请Chat GPT 的key
    https://github.com/chatanywhere/GPT_API_free
  2. 开源Chat GPT 网页
    https://github.com/Yidadaa/ChatGPT-Next-Web
  3. 云服务器
    https://idc.langlangy.com/server/purchase

申请key

Pasted image 20230722211120

Pasted image 20230722211240

开通linux服务器

Pasted image 20230722213351

购买地址

安装docker

# 安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2

# 安装docker
yum install docker-ce docker-ce-clicontainerd.io

Pasted image 20230722222854

启动Docker并开机启动

systemctl start docker

systemctl enable docker.service

Pasted image 20230722222941

拉取镜像

docker pull yidadaa/chatgpt-next-web

Pasted image 20230722223458

部署容器

docker run -d -p 3000:3000 \
   -e OPENAI_API_KEY="sk-你的key" \
   -e BASE_URL=https://api.chatanywhere.com.cn \
   yidadaa/chatgpt-next-web

Pasted image 20230722223621

关闭防火墙

systemctl stop firewalld.service 

systemctl disable firewalld.service

在服务器添加端口转发

Pasted image 20230722224120

Pasted image 20230722224239

浏览器访问

Pasted image 20230722224431

去掉端口访问

换1块钱购买一台虚拟主机

Pasted image 20230722225115

你的域名绑定这个ip

Pasted image 20230722225208

这是腾讯云绑定的
Pasted image 20230722225345
添加域名
Pasted image 20230722225618
在云服务器里找到这个nat ip

Pasted image 20230722225924

在虚拟主机里添加反向代理

Pasted image 20230722230439

浏览器访问

Pasted image 20230722230621
Pasted image 20230722231129

0
博主关闭了所有页面的评论