An open API service indexing awesome lists of open source software.

https://github.com/alextanhongpin/consul-docker-compose

Running a three node cluster for consul using docker compose and service registration with nodejs
https://github.com/alextanhongpin/consul-docker-compose

consul docker-compose

Last synced: about 1 month ago
JSON representation

Running a three node cluster for consul using docker compose and service registration with nodejs

Awesome Lists containing this project

README

          

# nodejs-consul

Using Consul for service discovery.

## Docker

Get the latest version of Consul with the following command:

```bash
$ docker pull consul
```

Running a three node cluster for development by starting up two more instances and telling them to join the first node.

```bash
# Setup the consul
$ docker-compose up -d

# Register the service on the server side
$ cd ./server && node server.js

# Listen to the changes of the registered service
$ cd ./client && node client.js
```

### UI
For displaying the ui, the following is needed
```bash
$ ... -ui -client=0.0.0.0 -bind='{{ GetPrivateIP }}'
```