By João Biondo
TLDR: How do I setup app platform so that my main service can do http calls internally to another container without it being exposed publicly?
My current application is composed of two containers, one that is exposed to /, and one that is a worker BUT receives http requests from the main container in order to work. I see that there’s no internal hostname/port for workers, so I need to instantiate it as a service, the problem is that this service isn’t supposed to be publicly exposed.
How do I do that?
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!
Workers cannot be accessed directly by other services or workers. We have a feature on the horizon that would allow for private services that can be accessed within the apps internal network and not publicly, though I don’t have a timeline when this will be released.
We released support for internal services yesterday. You can make use of these with the internal_ports field on service specs as follows:
name: sample-golang
services:
- name: web
github:
repo: digitalocean/sample-golang
branch: master
internal_ports:
- 3000
If you specify internal_ports without http_port, then the service will only be accessible via the internal network.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.