mikelangelo-project / osv-microservice-demo

Simple Node.js Microservice application use to demonstrate the use of OSv and Capstan
13 stars 1 forks source link

Support specifying service port with ENV #2

Closed miha-plesko closed 7 years ago

miha-plesko commented 7 years ago

Ports for services were hard-coded to:

8000 keyvaluestore
8001 db
8002 storage
8003 master

But these ports are often used by other services (e.g 8000 takes OSv http server, 8001 takes kubernetes GUI). Fixed this by changing default ports to 900x. Also supported setting port using environment variable. Variable name can be either PORT either MICRO_<service_name>_PORT. The first is useful when running in OSv and the latter when running locally.