mirror of
https://gitee.com/blackfox/geekai.git
synced 2024-12-02 20:28:00 +08:00
chore: 添加 docker 镜像构建脚本
This commit is contained in:
parent
05bdd81646
commit
1795a891ce
31
docker/build.sh
Executable file
31
docker/build.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=$1
|
||||
# build go api
|
||||
cd ../api/go
|
||||
make clean linux
|
||||
|
||||
# build web app
|
||||
cd ../../web
|
||||
npm run build
|
||||
|
||||
cd ../docker
|
||||
|
||||
# remove docker image if exists
|
||||
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 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
|
||||
|
Loading…
Reference in New Issue
Block a user