An open API service indexing awesome lists of open source software.

https://github.com/nekonenene/grpc_image

gRPC with Go (golang) and Docker
https://github.com/nekonenene/grpc_image

docker docker-image go golang grpc grpc-go

Last synced: 2 months ago
JSON representation

gRPC with Go (golang) and Docker

Awesome Lists containing this project

README

          

# gRPC image

gRPC with Go (golang) and Docker

## Requirement

* Docker

## Usage

1. Build images.
```sh
make build
```
Or, define [the version of protoc](https://github.com/protocolbuffers/protobuf/releases).
```sh
make build PROTOC_VER=x.x.x
```
2. Run the container to start the gRPC server.
```sh
make run
```

## Development

1. Put symlink, but **it's not necessary** if you develop in the docker container.
```sh
make init
```
2. When update `hello.proto`, you should also update `hello.pb.go`.
```sh
make pb_hello
```
3. When update `main.go`, rebuild the image and rerun the container.
```sh
make build_hello
make run
```

## Use TLS (SSL)

```sh
go run main.go -tls -cert_file ./creds/server.crt -key_file ./creds/server.key
```