Boilerplate of GRPC server for go
sqlcmigratelogr- Otle
- AAA
- Error handler (middleware)
The boilerplate do not provide pre-commit hooks of all sorts. Allow fast local commits is a major upside of DVCS. Clean commit can be achieved during pre-push or during pre-merge at PR level with CI scan.
See: Reddit Discussion
Two type of build:
make build-dev: static link but with debug info reservedmake build-prod: static link, omit the DWARF symbol, omit the symbol table-ldflags="-w -s"
docker build -t kickstart-go:v0.0.1 --build-arg BUILD_TYPE=prod .
Allowed value: one of [prod, dev]
docker build -t kickstart-go:v0.0.1 --build-arg APP_NAME=my-app .
Note
In the final image the binary will always be called app and located at /.
To change the name of the binary in the final image you need:
- change the destination of the copy path
COPY --from=builder /go/src/app/bin/${APP_NAME} /my-app
- change the endpoint
ENTRYPOINT ["/my-app"]
docker build -t kickstart-go:v0.0.1 --build-arg RUN_IMG=golang:alpine .
Default value: scratch