>PROBLEM
You've have an Angular project that uses a web services, for instance Java Spring Boot, that works on the environment that is was created, but when the projects (the client and the WS) are migrated to Docker containers, they fail to communicate.
>SOLUTION
If the usual call using localhost fails, replace it with “host.docker.internal”.
// usual, outside docker
//private serverUrl = 'http://localhost:8081'
// docker, if it fails localhost
private serverUrl = 'http://host.docker.internal:8080'
Detailed procedure here:
>ENV
Windows 10
Docker
Angular 7..13
Node.js 12..16
Docker
Angular 7..13
Node.js 12..16
No comments:
Post a Comment