Docker communication within VPS (ERR_NAME_NOT_RESOLVED)

If you set up a reverse proxy. Yes. Without reverse proxy http://my_domain_name:8080/api/whatever.

Just to be sure: my_domain_name is an entry in the dns server where you manage your domain. This is nothing docker is involved in.