# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
apt-get remove docker docker-engine docker.io
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install -y docker-ce docker-ce-cli containerd.io
systemctl enable docker
systemctl start docker
groupadd docker
usermod -aG docker $USER
# docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:faa03e786c97f07ef34423fccceeec2398ec8a5759259f94d99078f264e9d7af
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
# git clone https://github.com/fuergaosi233/wechat-chatgpt.git
# cd wechat-chatgpt/
1. https://chat.openai.com/chat登录
2. 浏览器打开更多工具>开发者工具。
3. 打开应用程序 > Cookies。
4. 复制 __Secure-next-auth.session-token 的值,配置config.yaml
https://chat.openai.com/api/auth/session
chatGPTAccountPool:
- session_token: <your session_token>
# cd wechat-chatgpt/
config.yaml
cp config.yaml.example config.yaml
chatGPTAccountPool:
- session_token: eyJh......
chatPrivateTiggerKeyword: ""
docker run -d --name wechat-chatgpt -v $(pwd)/config.yaml:/app/config.yaml holegots/wechat-chatgpt:latest
docker logs -f wechat-chatgpt
Cookies
__Secure-next-auth.session-token
值,修改config.yaml# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd62d8c0451b holegots/wechat-chatgpt:latest "npm run dev" 50 minutes ago Up 50 minutes wechat-chatgpt
# docker stop fd62d8c0451b
docker container rm wechat-chatgpt
1
docker run -d --name wechat-chatgpt -v $(pwd)/config.yaml:/app/config.yaml holegots/wechat-chatgpt:latest
# ping openai.com
PING openai.com (184.27.123.193) 56(84) bytes of data.
64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=1 ttl=47 time=385 ms
64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=2 ttl=47 time=377 ms
64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=3 ttl=47 time=377 ms
lighthouse@VM-0-12-ubuntu:~$ docker -v
Docker version 20.10.5, build 55c4c88
# git clone https://github.com/fuergaosi233/wechat-chatgpt.git
cp config.yaml.example config.yaml
vim config.yaml
把上一步获得的token,填在token位置
docker run -d --name wechat-chatgpt -v $(pwd)/config.yaml:/app/config.yaml holegots/wechat-chatgpt:latest
sudo docker logs -f wechat-chatgpt
有一个二维码出来,然后用自己的测试号扫码登陆
登陆之后,就可以用自己的大号与他聊天测试了
查看运行的docker即contarin的状态
lighthouse@VM-0-12-ubuntu:~$ sudo docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8f511d18643a holegots/wechat-chatgpt "npm run dev" 2 hours ago Up 29 minutes wechat-chatgpt
重启
sudo docker restart wechat-chatgpt
停止
sudo docker stop wechat-chatgpt
获得container id
sudo docker container ls -al
删除container
sudo docker container rm cd59
再重新运行
sudo docker run -d --name wechat-chatgpt -v $(pwd)/config.yaml:/app/config.yaml holegots/wechat-chatgpt