I don’t see any links keyword in your Docker Compose file (it’s deprecated anyway, so I recommend using libnetwork).
I’d recommend to use the V2 Compose format and define a network for both containers to live on. Then you can use Docker built-in DNS server to talk back and forth.
You don’t even need the ports definition in backend if you’re not exposing it to the outside world (i.e. if it’s only accessed by the frontend container).
why i have this error when i use your docker-compose
←[31mERROR←[0m: In file ‘.\docker-compose.yml’ service ‘version’ doesn’t have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.