Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zalopay-oss/docker-grpc-gateway
Build grpc-gateway with docker
https://github.com/zalopay-oss/docker-grpc-gateway
docker docker-grpc-gateway gateway grpc
Last synced: 2 months ago
JSON representation
Build grpc-gateway with docker
- Host: GitHub
- URL: https://github.com/zalopay-oss/docker-grpc-gateway
- Owner: zalopay-oss
- Created: 2019-06-12T02:12:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-26T00:19:36.000Z (over 5 years ago)
- Last Synced: 2024-06-21T19:53:54.742Z (8 months ago)
- Topics: docker, docker-grpc-gateway, gateway, grpc
- Language: Go
- Homepage:
- Size: 53.7 KB
- Stars: 42
- Watchers: 3
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker grpc-gateway
- [Docker grpc-gateway](#Docker-grpc-gateway)
- [Overview](#Overview)
- [Architecture Demo](#Architecture-Demo)
- [Requirement](#Requirement)
- [Installation](#Installation)
- [Build](#Build)
- [Run](#Run)
- [Test](#Test)
- [Contribution](#Contribution)
- [Acknowledgments](#Acknowledgments)## Overview
Building grpc-gateway has caused many difficulties for developers such as the installation of the Golang programming environment, protobuf, how to build,.... There is a simpler, less time-consuming solution that uses `Docker to build grpc-gateway`.
In this project, I would like to introduce the solution to use docker and demo how to use it. For more details, see [here](https://medium.com/zalopay-engineering/docker-grpc-gateway-e2efbdcfe5c-e2efbdcfe5c).
## Architecture Demo
## Requirement
- Docker
## InstallationInstall Docker:
- On [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
- On [MacOS](https://docs.docker.com/docker-for-mac/install/).
- On [Window](https://docs.docker.com/docker-for-windows/install/).
## Build```sh
#clone project
$ git clone https://github.com/zalopay-oss/docker-grpc-gateway.git
```## Run
- Run grpc-gateway
```sh
$ cd ./gateway/api/proto/gen/grpc-gateway#docker build -t grpc-gateway directory_contains_dockerfile
$ docker build -t grpc-gateway .#run image
$ docker run -p 9000:9000 --rm --link service-ping grpc-gateway
```- Run service
```sh
$ cd ./service#build image
$ docker build -t service-ping .#run image
$ docker run --name service-ping --rm service-ping
```
Or just use `docker-compose` for above step:
```shell script
$ docker-compose up -d --build
```
## Test- Test ServiceA
```sh
$ curl -X GET "http://localhost:9000/core/serviceA/ping/999999"
{"timestamp":"1560311912214","serviceName":"service A"}
```- Test ServiceB
```sh
curl -X GET "http://localhost:9000/core/serviceB/ping/999999"
{"timestamp":"1560312187849","serviceName":"service B"}
```## Contribution
If you find anything wrong or would like to contribute in any way, feel free to create a pull request/open an issue/send me a message. Any comments are welcome!
## Acknowledgments
- Thanks [Andy](https://github.com/anhldbk) for supporting me during the implementation project.
- Thanks [namely/docker-proto](https://github.com/namely/docker-protoc) for the open source is great.