How to run the docker-compose from Intellij

Y Sa
2 min readMay 22, 2021

--

We usually use the terminal to run the docker-compose via the command line:

docker-compose up 
Photo by Oskar Yildiz on Unsplash

Now, you can start directly the docker-compose file via Intellij

Read more: https://www.jetbrains.com/help/idea/run-debug-configuration-docker.html

Example docker-compose

version: "3.2"
services:
#RabbitMQ
rabbitmq:
image: rabbitmq:3-management
ports:
- '5672:5672'
- '15672:15672'
container_name: rabbitmq
networks:
my-network:
aliases:
- my-network
#MySQL
mysql:
image: mysql:5.7
ports:
- '3306:3306'
container_name: mysql
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: user
MYSQL_PASSWORD: root
networks:
my-network:
driver: bridge
volumes:
db_data: {}

Docker Configuration

Run/Debug Configuration

Name: Define the name

Server: choose Docker

Compose files: locate to the folder have to file docker-compose.yml

Services:

  • Leave empty to run all services
  • Run specific service: type the services you want to run

Now, try to start the Docker configuration and see the results, the docker file was executed and pull the image from the registry to local and starting the services.

This is my first story when I use Medium since 2017, I hope this was helpful for you, your comment will help me a lot to improve my skills ^^

--

--

Y Sa
Y Sa

Written by Y Sa

Software Engineer at ELCA VN

No responses yet