Skip to content

An example of simple service of gRPC, postgreSQL with basic authentication

Notifications You must be signed in to change notification settings

solodecode/pmg-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pmg-sample

An example of simple service of gRPC, postgreSQL with basic authentication and mTLS security Diagramm

Usage with pre-built images:

  1. Clone repo into your directory:
git clone https://github.com/solodecode/pmg-sample
  1. 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
  1. Create network for images:
docker network create pmg-sample
  1. 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
  1. 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.