Connected services
Have a frontend and an API that call each other? Deploy them together and Dockhold connects them by URL for you.
The problem it solves
When two services talk to each other, each one needs the other's URL. But neither URL exists until the service is deployed. So the usual dance is: deploy one, copy its URL, paste it into the second, redeploy, then go back and paste the second's URL into the first. Connected services remove that step. You declare which service needs which, and Dockhold fills in the URLs once each one is live.
How the wiring works
Each service is its own GitHub repository and gets its own URL, its own
size, and its own deploys. "Connected" means they're built together and
learn each other's URLs. You link them with environment variables: you pick
the variable name, point it at another service, and Dockhold sets its value
to that service's live https://…dockhold.app URL. Your code
just reads the variable.
// web service reads the API's URL from a name you chose
const apiUrl = process.env.API_URL;
const res = await fetch(`${apiUrl}/items`);
Nothing is magic here. If you name the link API_URL, your app
reads API_URL. There's no app-count limit, you just need enough
compute in your pool to cover every service.
Databases stay per service
Any service in a connected app can turn on its own
managed database with a checkbox, and
Dockhold injects its DATABASE_URL. Turn it on for the service
that actually queries the database, usually your API. A pure frontend
doesn't need one. Each database belongs to the service that enabled it.
Private services still need their token
Services reach each other over their public URLs, the same way any client would. If you make a service private, every caller must present an access token, including a sibling service. Connecting a public frontend to a private backend does not bypass that.
Builds run in parallel, so services don't all finish at once. A link reads as "waiting on" the service it still needs until that service is live, then connects, sometimes after one automatic restart. That's "not connected yet," not broken.
Do it step by step
This page is the what and why. For the click-by-click walkthrough (naming services, linking variables in the form, adding a database), see the recipe: Deploy connected services.