feat: add template

This commit is contained in:
王性驊 2025-03-01 23:21:55 +08:00
parent 727f949f50
commit dee9da8ffe
2 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,6 @@ fmt: # 格式優化
.PHONY: gen-rpc
gen-rpc: # 建立 rpc code
$(GO_CTL_NAME) rpc protoc ./generate/protobuf/notification.proto -m --style=$(GO_ZERO_STYLE) --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=.
copy ./etc/service.yaml ./etc/service.example.yaml
go mod tidy
@echo "Generate core-api files successfully"
@ -45,6 +44,6 @@ run-docker: # 建立 rpc code
.PHONY: build-docker
build-docker:
cp ./build/Dockerfile Dockerfile
docker buildx build -t $(DOCKER_REPO):$(VERSION) --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/ed_25519)" .
docker buildx build -t $(DOCKER_REPO):$(VERSION) --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519)" .
rm -rf Dockerfile
@echo "Generate core-api files successfully"

View File

@ -41,7 +41,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
FROM gcr.io/distroless/static-debian11
WORKDIR /app
COPY --from=builder /app/service /app/service
COPY --from=builder /app/etc/service.yaml /app/etc/service.yaml
COPY --from=builder /app /app
COPY --from=builder /app/etc/notification.yaml /app/etc/notification.yaml
EXPOSE 8080
CMD ["/app/notification"]