ubantu22.04安装docker

一套流程,docker,nginx,nvm,开启端口,最好一行一行跑

sudo apt update
sudo apt upgrade
apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get install docker-ce docker-ce-cli containerd.io
systemctl start docker
apt-get -y install apt-transport-https ca-certificates curl software-properties-common
service docker restart
docker -v
# 显示版本号就ok
apt install lrzsz tree

apt install nginx
cd /etc/nginx/
mkdir vhost
cd vhost/
# 导入自己的conf代理文件
rz
cd ..
vim nginx.conf
# 在第58行加入
include /etc/nginx/vhost/*.conf;
sudo systemctl restart nginx
nginx -t
# 配置gemini

docker run --name geminiprochat \
--restart always \
-p 3030:3000 \
-itd \
-e GEMINI_API_KEY=xxx \
howie6879/geminiprochat:v0.1.0

# 密钥自己找,免费的
# 安装nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# 然后最下面会弹出来三行命令,复制一下,粘进去运行

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# 注意:上面三行命令要在终端里面跑一下

nvm -v
nvm install v21.6.0
node -v
npm -v

# 其它环境,有空再写
# 安装chatgpt-next
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3001:3000 \
-e OPENAI_API_KEY=xxx \
-e GOOGLE_API_KEY=xx \
yidadaa/chatgpt-next-web


nginx


server {
listen 80;
server_name api.cwrising.top;

location / {
proxy_pass http://localhost:3000;

}
}

server {
listen 80;
server_name gemini.cwrising.top;

location / {
proxy_pass http://localhost:3030;

}
}

server {
listen 80;
server_name gpt.cwrising.top;

location / {
proxy_pass http://localhost:3001;

}
}