Docker-compose Redis

<< Docker Getting Started Docker Redis Image >>

Docker-compose Redis

Docker-compose is a tool that helps you build and manage container-based applications quickly and easily using Docker. Docker-compose uses a YAML configuration file to define the containers your application needs. Through the configuration file, you can define container images, ports, networks, volumes, and more.

Using Docker-compose has the following advantages.
• You can build and manage the application's containers all at once.
• You can easily manage dependencies between containers.
• You can easily configure container networks.
• You can easily manage container volumes.

With Docker Compose, you can simply define and run a complex application stack made up of multiple containers. You typically use a YAML file to define the application's services, networks, volumes, and more, and you can easily manage all containers with that file.

For example, when you set up a web application with multiple services using Docker Compose, you can define each service as an independent container and set dependency and communication rules between services. Then you can start or stop the entire application stack with a single command.

Docker Compose lets you deploy and run applications consistently across development, test, and production environments, which can improve scalability and maintainability.

Install Docker-compose

💻 Terminal

Add execute permission

💻 Terminal

Check the Docker-compose version

💻 Terminal

Create a docker-compose.yml file

For Redis server
📄 docker-compose.yml

For Sentinel
📄 docker-compose.yml

For Cluster
📄 docker-compose.yml
  • network_mode: host was chosen with performance in mind.
  • If you set Label, you can query by standalone/sentinel/cluster type with docker ps -f (filter) label=mode=standalone.
  • The container hostname was set. This way, the hostname can be displayed when you connect via a shell.
  • 💻 Terminal

Start

💻 Terminal

Stop

💻 Terminal

Create a cluster

Usage such as creating a cluster is the same as regular Redis.
Use the host IP.
💻 Terminal



<< Docker Getting Started Docker Redis Image >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.