This commit is contained in:
laodaming 2023-08-03 16:49:25 +08:00
parent b40293fdd9
commit 9f01ecaf80
20 changed files with 47 additions and 19 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@
*.dll
*.so
*.dylib
bin/
# Test binary, built with `go test -c`
*.test

10
fs_package_docker_image.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
name=${1%%\\*}
#进入对应服务目录
cd server/$name
#构建二进制文件
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/api-$name-srv ./$name.go
#删除之前旧的镜像
docker rmi -f api-$name-srv:latest
#打包docker镜像
docker build -t api-$name-srv:latest .

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-assistant-srv /www/fusenapi/
COPY ./bin/api-assistant-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-assistant-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-backend-srv /www/fusenapi/
COPY ./bin/api-backend-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-backend-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-canteen-srv /www/fusenapi/
COPY ./bin/api-canteen-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-canteen-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-data-transfer-srv /www/fusenapi/
COPY ./bin/api-data-transfer-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-data-transfer-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-home-user-auth-srv /www/fusenapi/
COPY ./bin/api-home-user-auth-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-home-user-auth-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-inventory-srv /www/fusenapi/
COPY ./bin/api-inventory-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-inventory-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-map-library-srv /www/fusenapi/
COPY ./bin/api-map-library-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-map-library-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-order-srv /www/fusenapi/
COPY ./bin/api-order-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-order-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-pay-srv /www/fusenapi/
COPY ./bin/api-pay-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-pay-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-product-model-srv /www/fusenapi/
COPY ./bin/api-product-model-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-product-model-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-product-template-tag-srv /www/fusenapi/
COPY ./bin/api-product-template-tag-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-product-template-tag-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-product-template-srv /www/fusenapi/
COPY ./bin/api-product-template-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-product-template-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-product-srv /www/fusenapi/
COPY ./bin/api-product-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-product-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-render-srv /www/fusenapi/
COPY ./bin/api-render-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-render-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-shopping-cart-confirmation-srv /www/fusenapi/
COPY ./bin/api-shopping-cart-confirmation-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-shopping-cart-confirmation-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-upload-srv /www/fusenapi/
COPY ./bin/api-upload-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-upload-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-webset-srv /www/fusenapi/
COPY ./bin/api-webset-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-webset-srv"]

View File

@ -1,5 +1,6 @@
FROM alpine
WORKDIR /www/fusenapi/
COPY ./api-websocket-srv /www/fusenapi/
COPY ./bin/api-websocket-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
CMD ["/www/fusenapi/api-websocket-srv"]