https://github.com/ruanbekker/docker-node-containername
Nodejs Application for Docker to Print Hostnames
https://github.com/ruanbekker/docker-node-containername
alpine alpine-linux docker docker-compose docker-stack docker-swarm haproxy javascript nodejs
Last synced: 5 months ago
JSON representation
Nodejs Application for Docker to Print Hostnames
- Host: GitHub
- URL: https://github.com/ruanbekker/docker-node-containername
- Owner: ruanbekker
- Created: 2017-09-24T21:30:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-24T21:49:10.000Z (over 8 years ago)
- Last Synced: 2025-08-30T09:44:04.517Z (5 months ago)
- Topics: alpine, alpine-linux, docker, docker-compose, docker-stack, docker-swarm, haproxy, javascript, nodejs
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-node-containername
Nodejs Application for Docker to Print Hostnames
## Docker Hub:
- https://hub.docker.com/r/rbekker87/node-containername/
## Usage:
Launch the Stack:
```
$ git clone https://github.com/ruanbekker/docker-node-containername
$ cd docker-node-containername
$ docker stack deploy -c docker-compose.yml node
```
List the Services in the Stack:
```
$ docker stack ls
NAME SERVICES
node 2
```
List the Tasks in the Stack:
```
$ docker stack ps node
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
l5ryfaedzzaq node_loadbalancer.1 dockercloud/haproxy:latest dsm-01 Running Running 40 minutes ago
c8nrrcvek79h node_node-app.5 rbekker87/node-containername:latest dsm-01 Running Running 40 minutes ago
dqii18b2q5nn node_node-app.10 rbekker87/node-containername:latest dsm-01 Running Running 40 minutes ago
vkpw2rugy0ah node_node-app.11 rbekker87/node-containername:latest dsm-01 Running Running 40 minutes ago
mm88nvnvy5lg node_node-app.12 rbekker87/node-containername:latest dsm-01 Running Running 40 minutes ago
oyx8rfqc1xl2 node_node-app.16 rbekker87/node-containername:latest dsm-01 Running Running 41 minutes ago
```
Test out the Service:
```
$ curl -XGET http://127.0.0.1/
My Hostname: a6e34246e73b
$ curl -XGET http://127.0.0.1/
My Hostname: 5de71278be38
$ curl -XGET http://127.0.0.1/
My Hostname: e0b7316fdd51
```
Remove the Stack:
```
$ docker stack rm node
Removing service node_loadbalancer
Removing service node_node-app
Removing network node_nodenet
```