chore: remove proto codegen from prod Dockerfile

This commit is contained in:
2026-08-17 14:13:51 +08:00
parent daca23fe0d
commit 288dccfd94
2 changed files with 5 additions and 29 deletions
+4 -19
View File
@@ -7,29 +7,15 @@ Part of a multi-repo project. Parent `../AGENTS.md` has full architecture contex
## Build & Run
```bash
go run main.go # requires generated proto stubs first
go run main.go
go build -o collab-go main.go
```
Port: `1234` (override with `ADDR` env var).
### Prerequisites — generated proto stubs
### Protobuf
`pkg/gen/` is gitignored. Code **will not compile** without it. Generate from the parent directory:
```bash
# Option A: parent repo script (recommended)
bash ../deploy/script/gen_proto.sh
# Option B: manual protoc (requires protoc-gen-go + protoc-gen-go-grpc)
mkdir -p pkg/gen
protoc -I ../proto \
--go_out=pkg/gen --go_opt=paths=source_relative \
--go-grpc_out=pkg/gen --go-grpc_opt=paths=source_relative \
../proto/yoresee_doc/v1/yoresee_doc.proto
```
Install codegen tools: `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest`
Consumes Go stubs (`yoreseedocpb`) from `git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go`, pinned to tag `v0.1.0` in `go.mod`. No local codegen required.
## Environment Variables
@@ -57,14 +43,13 @@ go build ./...
- `handler/` — WebSocket upgrade, auth check, doc-existence check via gRPC, proxy to collab-core
- `health/` — `/health`, `/readyz`, `/livez` probes (readiness checks backend gRPC)
- `proxy/` — bidirectional WebSocket proxy to collab-core at path `/doc-{docID}`
- `pkg/gen/` — generated protobuf stubs (gitignored)
Connection flow: `Browser → /ws/doc/{docId}?token=... → collab-go (auth + gRPC doc check) → collab-core /doc-{docId}`
## Docker
- `Dockerfile` — dev image, runs `go run main.go`
- `Dockerfile.prod` — production build; **expects build context at parent directory** (`COPY collab-go/...`). Proto codegen runs inside the build.
- `Dockerfile.prod` — production build; **expects build context at parent directory** (`COPY collab-go/...`).
## Conventions