Chapter 8 – Deploying the Application on AWS
- Create a Docker volume with the following command:
docker volume create mongodata
Then mount the volume while running the Docker container:
docker run -d -p 27017:27017 -v mongodata:/data/db --name mongodb mongodb:4.4.3
- To deploy RabbitMQ, you can use the docker-compose.yml to deploy an additional service based on the RabbitMQ official image as follows:
rabbitmq: image: rabbitmq:3-management ports: - 8080:15672 environment: - RABBITMQ_DEFAULT_USER=admin - RABBITMQ_DEFAULT_PASS=password
- Create the user's credentials in the form of a Kubernetes secret:
kubectl create secret generic mongodb-password --from-literal="password=YOUR_PASSWORD"
Once we have created the secret, we need to update
mongodb-deployment...