feat/refactor #11

Merged
daniel.w merged 5 commits from feat/refactor into main 2025-03-08 02:50:32 +00:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit dee9da8ffe - Show all commits

View File

@ -23,7 +23,6 @@ fmt: # 格式優化
.PHONY: gen-rpc .PHONY: gen-rpc
gen-rpc: # 建立 rpc code 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=. $(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 go mod tidy
@echo "Generate core-api files successfully" @echo "Generate core-api files successfully"
@ -45,6 +44,6 @@ run-docker: # 建立 rpc code
.PHONY: build-docker .PHONY: build-docker
build-docker: build-docker:
cp ./build/Dockerfile Dockerfile 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 rm -rf Dockerfile
@echo "Generate core-api files successfully" @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 FROM gcr.io/distroless/static-debian11
WORKDIR /app WORKDIR /app
COPY --from=builder /app/service /app/service COPY --from=builder /app /app
COPY --from=builder /app/etc/service.yaml /app/etc/service.yaml COPY --from=builder /app/etc/notification.yaml /app/etc/notification.yaml
EXPOSE 8080 EXPOSE 8080
CMD ["/app/notification"] CMD ["/app/notification"]