Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Deploying Redis, Elasticsearch, & RabbitMQ with Docker Desktop

Development on Docker

Overview

Container technology emerged as an essential tool for the deployment and development of applications. Since containerization has become more popular, Docker has made it easier to create, test and deploy apps across several platforms. Yet, using Docker might be difficult at times, especially for new users. Docker Desktop can help with that.

An easy-to-use graphical interface is provided by Docker Desktop for managing Docker containers and images. In this article, we’ll examine Docker Desktop’s features and how they might help your development workflow.

We will be deploying the below list of platforms on Docker Desktop :

  1. Redis database
  2. Elasticsearch database
  3. MySQL
  4. RabbitMQ
  5. Adminer (db-client)

Prerequisite

  • Docker Desktop — Download & setup now

Let’s do it

We may proceed with running the first database, Redis, once the docker desktop is up and running.

Execute the command below in a terminal.

docker run -d -p 6379:6379 redis

With port-forward enabled, this will pull and launch the Redis container on localhost’s port 6379.

Verify that the redis container is up and operating.

docker ps

As soon as the redis container is running, we can connect to it and use it. We will now run the command to connect to the database in the terminal. Redis-cli can be installed or set up locally to connect to the redis DB container.

redis-cli -h localhost -p 6379

Now that you are connected to the Redis database, using Docker to quickly set up several applications for development purposes without actually installing them on the system is quite simple.

Now that we have added additional applications, let’s use the docker-compose option to do so.

Save the following document as docker-compose.yaml

In the same directory, create a new shell script file called run-compose.sh

#!/bin/bash
docker pull mysql:5.7
docker pull rabbitmq:3-management
docker pull redis
mkdir -p volume
if [ ! -d "$PWD/volume/elasticsearch" ]; then
mkdir -p volume/elasticsearch/data
chmod 777 -R $PWD/volume/elasticsearch/
fi
if [ ! -d "$PWD/volume/mysql" ]; then
mkdir -p volume/mysql/data
chmod 777 -R $PWD/volume/mysql
fi
mkdir -p volume/rabbitmq/data
mkdir -p volume/redis/data
if [ -z $1 ]; then
chmod 777 -R $PWD/volume/
docker-compose -f docker-compose.yml up -d
elif [[ $1 = "up" ]]; then
chmod 777 -R $PWD/volume/
elif [[ $1 = "down" ]]; then
docker-compose -f docker-compose.yml down
fi

Now launch the shell script we made on the terminal. The shell script will build the required folder, pull the images first, and then run the docker-compose.yaml, enabling you to begin utilizing your defined application for development.

Run command to check container status

docker ps

Service will be accessible on below points

  1. Redis database — localhost:6379
  2. Elasticsearch database — localhost:9200
  3. MySQL-localhost:3306
  4. RabbitMQ-localhost:15672
  5. Adminer (db-client)-localhost:8080

So, you may quickly and easily build up development-related tools and databases using the Docker desktop.

Docker desktop benefits

  • Docker Desktop gives developers the freedom to package their apps and dependencies into containers.
  • Environments that are constant: With Docker Desktop, developers can build environments that are consistent, guaranteeing that team members are using the same tools and software versions.
  • Streamlined deployment: By containerizing their apps with Docker Desktop, developers can streamline the deployment procedure, making it quicker and more dependable.
  • Docker Desktop allows developers to quickly spin up new containers for testing and development
  • Docker Desktop makes it easy to scale applications by adding or removing containers as needed
  • It also provides an option to start the Kubernetes cluster from the UI option

👋 If you find this helpful, please click the clap 👏 button below a few times to show your support for the author 👇

🚀Join FAUN Developer Community & Get Similar Stories in your Inbox Each Week


Deploying Redis, Elasticsearch, & RabbitMQ with Docker Desktop was originally published in FAUN — Developer Community 🐾 on Medium, where people are continuing the conversation by highlighting and responding to this story.

Share the post

Deploying Redis, Elasticsearch, & RabbitMQ with Docker Desktop

×

Subscribe to Top Digital Transformation Strategies For Business Development: How To Effectively Grow Your Business In The Digital Age

Get updates delivered right to your inbox!

Thank you for your subscription

×