MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Docker Compose Tutorials: Wait for container one before starting container second

Reference
https://stackoverflow.com/questions/31746182/docker-compose-wait-for-container-x-before-starting-y

Questions
I am using rabbitmq and a simple python sample from here together with docker-compose. My problem is that I need to wait for rabbitmq to fully started. From what I searched so far, I don’t know how to wait with container x ( in my case worker ) until y (rabbitmq) is started.

Answer

Since docker-compose file format 2.1 you can define healthchecks.

Now I test if the management page of the rabbitmq-container is available. If curl finishes with exitcode 0 the container app (python pika) will be started and publish a message to hello queue. Its now working (output).

Docker Tutorials Fundamental To Advanced-2021 Crash Course:- https://bit.ly/3hOIbTB

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Docker Compose: WordPress + MySQL Using Shared Environment Variables

Create a project folder: Create a .env file: Create docker-compose.yml: Start the containers: Open WordPress: Now students can see how environment variables are passed into both containers….

Read More

Graphite: How to install and Configure graphite monitoring tool

Commands to run all setup Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and…

Read More

DOTNET: RabbitMQ with .net Demo and Lab Example

We’ll run RabbitMQ in Docker on an AWS EC2 instance, and use your Windows laptop for both the producer and consumer. I’ll walk you through: 1. Provision…

Read More

DOTNET: High-Performance Messaging in .NET: Service Bus vs RabbitMQ vs Kafka (and Event-Driven Architecture with RabbitMQ)

1. Big picture – why messaging in .NET? In modern .NET systems, you almost never want services talking to each other via direct HTTP calls only. Messaging…

Read More

RabbitMQ vs Kafka vs ActiveMQ: feature and performance table

RabbitMQ, Kafka, and ActiveMQ are three popular message brokers, each designed for different use cases. Here’s a detailed comparison of RabbitMQ vs Kafka vs ActiveMQ based on…

Read More

What is DevContainer?

Here’s a comparative table highlighting the differences and use cases of DevContainers, Kubernetes, and Docker Containers: Aspect DevContainers Kubernetes Docker Containers Definition A development environment that uses…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x