mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-26 10:05:57 +08:00
feat: merge mysql and redis docker service to docker-compose.yaml file
This commit is contained in:
26
build/build.sh
Executable file
26
build/build.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=$1
|
||||
# build go api
|
||||
cd ../api
|
||||
make clean linux
|
||||
|
||||
# build web app
|
||||
cd ../web
|
||||
npm run build
|
||||
|
||||
cd ../docker
|
||||
|
||||
# remove docker image if exists
|
||||
docker rmi -f registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:$version
|
||||
# build docker image for chatgpt-plus-go
|
||||
docker build -t registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:$version -f dockerfile-api-go ../
|
||||
|
||||
# build docker image for chatgpt-plus-vue
|
||||
docker rmi -f registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:$version
|
||||
docker build --platform linux/amd64 -t registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:$version -f dockerfile-vue ../
|
||||
|
||||
if [ "$2" = "push" ];then
|
||||
docker push registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:$version
|
||||
docker push registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:$version
|
||||
fi
|
||||
12
build/dockerfile-api-go
Normal file
12
build/dockerfile-api-go
Normal file
@@ -0,0 +1,12 @@
|
||||
# GO api docker 镜像创建
|
||||
FROM alpine:3.18.2
|
||||
|
||||
MAINTAINER yangjian<yangjian102621@163.com>
|
||||
|
||||
WORKDIR /var/www/app
|
||||
COPY ./api/bin/chatgpt-plus-amd64-linux /var/www/app
|
||||
|
||||
EXPOSE 5678
|
||||
|
||||
# 容器启动时执行的命令
|
||||
CMD ["./chatgpt-plus-amd64-linux"]
|
||||
11
build/dockerfile-vue
Normal file
11
build/dockerfile-vue
Normal file
@@ -0,0 +1,11 @@
|
||||
# 前端 Vue 项目构建
|
||||
FROM nginx:1.20.2
|
||||
|
||||
MAINTAINER yangjian<yangjian102621@163.com>
|
||||
|
||||
WORKDIR /var/www/app
|
||||
COPY ./web/dist /var/www/app/dist
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
EXPOSE 8080
|
||||
Reference in New Issue
Block a user