From dee9da8ffe591155a423f8df9299ed3ae5fd12af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A7=E9=A9=8A?= Date: Sat, 1 Mar 2025 23:21:55 +0800 Subject: [PATCH] feat: add template --- Makefile | 3 +-- build/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 61fc00b..6c7922a 100644 --- a/Makefile +++ b/Makefile @@ -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" diff --git a/build/Dockerfile b/build/Dockerfile index f9941c4..38ea0e9 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -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"] \ No newline at end of file