How can I run NodeJs in Docker and Connect it with MongoDB and RabbitMQ?
Do I need to run it in with docker-compose
?
And also I need 2 environment
nodemon
.node app.js
I found this docker-compose
yml, but I can not understand how to connect it from nodejs
services:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
environment:
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_ERLANG_COOKIE}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
After a few days, I found this repo with RabbitMQ, MongoDB. Also here you can find Mongo-express, where you can work with Mongo directly.
https://github.com/stdakov/docker-rabbit-mongo
Installation:
git clone https://github.com/stdakov/docker-rabbit-mongo.git
cd docker-rabbit-mongo/
docker-compose up -d