Based on these tutorials:
- gRPC and REST Microservice using Go
- Building a Docker image for your Go based microservice
- Go Modules
- MySQL in Docker Container
- Code Coverage Reporting
-
Run Protoc
./third_party/protoc-gen.sh
-
Build Server
cd cmd/server go build
-
Build REST and gRPC Clients
cd cmd/client-rest go build cd cmd/client-grpc go build
Build Docker Image
docker build . -t go-dock
docker run -d -p 8080:8080,9090:9090 --name=go-dock --env DB_HOST=localhost:3306,DB_USER=root,DB_PASSWORD=**********,DB_SCHEMA=mysql go-dock
docker run -it -p 8080:8080,9090:9090 --name=go-dock --env DB_HOST=localhost:3306,DB_USER=root,DB_PASSWORD=**********,DB_SCHEMA=mysql go-dock
docker pull mysql/mysql-server:latest
docker images
docker run --name=mysql -d mysql/mysql-server:latest