An example of simple service of gRPC, postgreSQL with basic authentication and mTLS security
- Clone repo into your directory:
git clone https://github.com/solodecode/pmg-sample
- Pull docker images:
docker pull ghcr.io/solodecode/pmg-sample/cmd/server:latest
docker pull ghcr.io/solodecode/pmg-sample/cmd/client:latest
docker pull postgres:latest
- Create network for images:
docker network create pmg-sample
- Run PostgreSQL:
docker run --network pmg-sample --name pg -e POSTGRES_DB=test -e POSTGRES_PASSWORD=test -v $(pwd)/scripts/sql/create.sql:/docker-entrypoint-initdb.d/init.sql postgres
- Run server and client images:
docker run -e DATABASE_URL=postgres://yourlogin:yourpwd@pg:5432/test --name server -p 5333:5333 --network pmg-sample ghcr.io/solodecode/pmg-sample/cmd/server
docker run --network pmg-sample ghcr.io/solodecode/pmg-sample/cmd/client
Now you will receive logs of adding a product to the table every 5 seconds.