-
Notifications
You must be signed in to change notification settings - Fork 4
Run Nodes in docker containers for test
Mikael Håkansson edited this page Jul 24, 2018
·
12 revisions
These instructions is suited for running a bunch of nodes in separate containers.
- Create a file called "Dockerfile" with the following content:
FROM node:8
RUN npm install microservicebus-node
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
- Create a file called "entrypoint.sh" with the following content:
#!/bin/sh
echo "$1"
cd node_modules/microservicebus-node
node start -c $1 -n $2
- Create a docker image:
docker build -t msb .
- Create your node and generate a code
- Create a node container:
docker run -d --name [NODENAME] msb [CODE] [NODENAME]
# Eg.
docker run -d --name node-00001 msb QQIN643B node-00001
- To stop the container:
docker stop node-00001
# Stop all containers:
docker stop $(docker ps -q)
- To start the container:
docker start node-00001
# Start all containers:
docker start $(docker ps -a -q)