Question

How can I expose one Docker container on the App Platform to Another?

Hey there,

I know that when I run some Docker containers locally using Docker Compose, if I configure it correctly, a container can access another container via its hostname.

For example, if I have two containers, a Celery Worker and a RabbitMQ container (the RabbitMQ container exposes port 5672). When the RabbitMQ container starts, I can connect to the RabbitMQ queue from the Celery container using the RabbitMQ container name, something like:

rabbitmq:5672

I tried looking for this in the DigitalOcean docs but I couldn’t find anything. Do I just use the container name the same way I would if I was running them locally?

Also, with Docker Compose, I can tell Celery to depend on RabbitMQ, i.e. it won’t start until the RabbitMQ container is up and healthy. Is that also possible with AppPlatform?

Just to add, everything I’m running all apps in Docker containers on AppPlatform.

Thanks in advance!

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Jon Friesen
DigitalOcean Employee
DigitalOcean Employee badge
October 4, 2022
Accepted Answer

👋 Mark,

Components within the same app can be accessed by their component name. For example, if I had a service with the name “api” that exposed an http server, it can be accessed at http://api.

App Platform does not have the functionality to depend on other component start up times. That sounds like it could be a good feature for us to implemement though, feel free to submit it as an Idea.

Hope this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.