mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 02:03:42 +08:00
opt: 优化 docker-compse 构建脚本,修复后端路由 Bug
This commit is contained in:
@@ -12,20 +12,20 @@ npm run build
|
||||
cd ../docker
|
||||
|
||||
# remove docker image if exists
|
||||
docker rmi registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-go:$version
|
||||
docker rmi chatgpt-plus-go:$version
|
||||
# build docker image for chatgpt-plus-go
|
||||
docker build -t chatgpt-plus-go:$version -f dockerfile-api-go ../
|
||||
|
||||
# build docker image for chatgpt-plus-vue
|
||||
docker rmi registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-vue:$version
|
||||
docker rmi chatgpt-plus-vue:$version
|
||||
docker build -t chatgpt-plus-vue:$version -f dockerfile-vue ../
|
||||
|
||||
# add tag for aliyum docker registry
|
||||
goImageId=`docker images |grep chatgpt-plus-go |grep $version |awk '{print $3}'`
|
||||
docker rmi registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-go:$version
|
||||
docker tag $goImageId registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-go:$version
|
||||
|
||||
vueImageId=`docker images |grep chatgpt-plus-vue |grep $version |awk '{print $3}'`
|
||||
docker rmi registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-vue:$version
|
||||
docker tag $vueImageId registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-vue:$version
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Listen = "0.0.0.0:5678"
|
||||
ProxyURL = "http://127.0.0.1:7777"
|
||||
ProxyURL = "http://192.168.3.200:7777"
|
||||
MysqlDns = "root:12345678@tcp(192.168.3.200:3306)/chatgpt_plus?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
|
||||
[Session]
|
||||
|
||||
@@ -35,7 +35,7 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_pass http://192.168.3.200:5678; # 这里改成后端服务的内网 IP 地址
|
||||
proxy_pass http://192.168.3.200:6789; # 这里改成后端服务的内网 IP 地址
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,21 +2,20 @@ version: '3'
|
||||
services:
|
||||
# 后端 API 程序
|
||||
chatgpt-plus-go:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-go:v3.0.0
|
||||
# image: chatplus-go:v3.0.0
|
||||
image: registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-go:v3.0.1
|
||||
# image: chatgpt-plus-go:v3.0.1
|
||||
container_name: chatgpt-plus-go
|
||||
#build: ./
|
||||
restart: always
|
||||
# network_mode: host
|
||||
# network_mode: host
|
||||
ports:
|
||||
- "5678:5678"
|
||||
- "6789:5678"
|
||||
volumes:
|
||||
- ./conf/config.toml:/var/www/app/config.toml
|
||||
|
||||
# 前端应用
|
||||
chatgpt-vue:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-vue:v3.0.0
|
||||
# image: chatplus-vue:v3.0.0
|
||||
image: registry.cn-hangzhou.aliyuncs.com/geekmaster/chatgpt-plus-vue:v3.0.1
|
||||
# image: chatgpt-plus-vue:v3.0.1
|
||||
container_name: chatgpt-plus-vue
|
||||
#build: ./
|
||||
restart: always
|
||||
|
||||
@@ -8,5 +8,8 @@ COPY ./api/go/bin/chatgpt-v3-amd64-linux /var/www/app
|
||||
|
||||
EXPOSE 5678
|
||||
|
||||
RUN apt-get -qq update \
|
||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||
|
||||
# 容器启动时执行的命令
|
||||
CMD ["./chatgpt-v3-amd64-linux"]
|
||||
|
||||
@@ -6,4 +6,6 @@ MAINTAINER yangjian<yangjian102621@163.com>
|
||||
WORKDIR /var/www/app
|
||||
COPY ./web/dist /var/www/app/dist
|
||||
|
||||
EXPOSE 80 443 8080
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
EXPOSE 8080
|
||||
Reference in New Issue
Block a user