Maybe you have a stack of applications that needs to communicate. Seeing db.localhost is a little easier to read that db:3360, but especially if you have multiple web applications. It's easier to read sso.localhost, api.localhost, and www.localhost.
They also show having the webserver to the TLS, that might be helpful.
They also show having the webserver to the TLS, that might be helpful.