Skip to content

Run msb node in docker

Mikael Håkansson edited this page Apr 7, 2022 · 1 revision

Run microservicebus-node as a docker container instance

  1. Create a Dockerfile
FROM ubuntu
RUN apt update
RUN yes | apt install wireguard
RUN yes | apt install curl
RUN curl -sL https://deb.nodesource.com/setup_14.x -o /tmp/nodesource_setup.sh
RUN bash /tmp/nodesource_setup.sh
RUN apt-get install nodejs
RUN npm install microservicebus-node
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
  1. Create entrypoint.sh
#!/bin/sh
cd node_modules/microservicebus-node
export NODE_PATH=/usr/local/lib/node_modules
node start -env quintus.microservicebus.com

Commands

# Build your container
docker build -t msb .

# Run the container
docker run -d --name [YOUR COINTAINER NAME] msb

# Attach to your container instance
docker exec -it [YOUR COINTAINER NAME] bash

# Stop the container instance
docker stop [YOUR COINTAINER NAME]

# Remove your container instance
docker rm [YOUR COINTAINER NAME]