Add Dockerfile and Makefile for building and generating Protobuf code

This commit is contained in:
2025-06-27 18:36:51 +08:00
parent b9cd25e9b4
commit 5be0d4db06
2 changed files with 39 additions and 0 deletions

14
Makefile Normal file
View File

@@ -0,0 +1,14 @@
PROTOC_GEN_GO := protoc-gen-go
PROTOC_GEN_GO_GRPC := protoc-gen-go-grpc
PROTO_DIR := pkg/pb
PROTO_FILE := $(PROTO_DIR)/data_service/data.proto
OUT_DIR := $(PROTO_DIR)
.PHONY: proto
proto:
@echo "Generating Go code from Protobuf..."
protoc \
--go_out=$(OUT_DIR) --go_opt=paths=source_relative \
--go-grpc_out=$(OUT_DIR) --go-grpc_opt=paths=source_relative \
$(PROTO_FILE)
@echo "Protobuf generation complete."