I have two apps deployed to the same dokku instance, an api service that pulls data from an external api, and an emailer service that hits endpoints on the api service and sends out emails depending on endpoint data. How can I link the emailer app to use the api app possibly using something like an env var API_URL in the emailer app?
The problem is that neither of the services need to be exposed to the web, so I don't want to expose the api service (it only needs to be used by the emailer service)
You can attach both apps to a network to enable inter-app routing, setting the API_URL env var to the correct value based on the name of the app/process type/port combination you are routing to, and then disabling public app proxying. Below is an example of how to perform this task.