update docker
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ api
|
|||||||
node_modules
|
node_modules
|
||||||
*.lock
|
*.lock
|
||||||
target
|
target
|
||||||
|
app/data
|
||||||
|
14
Dockerfile
14
Dockerfile
@@ -1,14 +1,8 @@
|
|||||||
FROM syui/aios
|
FROM archlinux
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm go
|
#RUN pacman -Syu --noconfirm
|
||||||
WORKDIR /app
|
|
||||||
RUN git clone https://git.syui.ai/ai/api tmp
|
|
||||||
|
|
||||||
WORKDIR /app/tmp
|
|
||||||
RUN go build
|
|
||||||
RUN mv api /app/api
|
|
||||||
|
|
||||||
#ADD ./app /app
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY api /app/
|
||||||
|
|
||||||
ENTRYPOINT ["/app/api"]
|
ENTRYPOINT ["/app/api"]
|
||||||
|
15
build.zsh
15
build.zsh
@@ -4,8 +4,12 @@ d=${0:a:h}
|
|||||||
cd $d
|
cd $d
|
||||||
su=10000
|
su=10000
|
||||||
|
|
||||||
|
|
||||||
go1.21.8 generate ./...
|
go1.21.8 generate ./...
|
||||||
|
|
||||||
#go generate ./...
|
#go generate ./...
|
||||||
|
#PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go run -mod=mod main.go
|
||||||
|
|
||||||
cp -rf $d/ent/openapi.json $d/tmp/
|
cp -rf $d/ent/openapi.json $d/tmp/
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
@@ -20,6 +24,11 @@ case $OSTYPE in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
cp -rf $d/tmp/ogent ent/
|
cp -rf $d/tmp/ogent ent/
|
||||||
#f=~/.config/ai/api_card.json
|
f=~/.config/ai/api_card.json
|
||||||
#PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go build
|
|
||||||
#PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go run -mod=mod main.go
|
if [ -f ./.env ];then
|
||||||
|
rm .env
|
||||||
|
fi
|
||||||
|
echo PASS=`cat ~/.config/ai/api_card.json|jq -r .password` >> .env
|
||||||
|
echo TOKEN=`cat ~/.config/ai/api_card.json|jq -r .token` >> .env
|
||||||
|
PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go build
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8188:8080
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
restart: always
|
restart: always
|
||||||
|
Reference in New Issue
Block a user