No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ms_gateway
ms_one
ms_two
LICENSE
README.md

README.md

Microservice-NodeJS-Docker-Template

This is a Template for a simple microservice architecture build with dockerized node.js Services. The images use the alpine image, to keep a small size. The services hide behind a gateway, that could be reached on port 8080 on the localhost.

Setup

Build the Images

cd into projectfolder

docker build -t florian/ms_one ./ms_one/
docker build -t florian/ms_two ./ms_two/
docker build -t florian/ms_gateway ./ms_gateway/

Run the Services

docker run -d --name ms_one -e SERVICE_NAME=ms_one -l=api_route='/ms_one' --expose 3000 florian/ms_one
docker run -d --name ms_two -e SERVICE_NAME=ms_two -l=api_route='/ms_two' --expose 3000 florian/ms_two
docker run -d --name ms_gateway -e SERVICE_NAME=ms_gateway -l=api_route='/ms_gateway' --expose 8080 florian/ms_ms_gateway

Usage

GET http://localhost:8080/ms_one
GET http://localhost:8080/ms_two

License

MIT License

Copyright (c) 2017 Florian Eichin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.