I’ve created 3 Docker containers containing an API, Front-end and a database. All containers are linked and the API can make a connection with the database. Also, other machines in the network can connect to the API and get data. However, the front-end is a different story. I am constantly receiving a ERR_NAME_NOT_RESOLVED when I try to do an action on the site that requires something from the API.
I am using the following commands to create the container and run it:
sudo docker build -t transfer-hub-front:spring-docker .
sudo docker run -d --name transfer-hub-front --link transfer-hub-core:transfer-hub-front -p 9093:80 transfer-hub-front:spring-docker In my Dockerfiles I am exposing the ports mentioned in the -p section.
I’ve opened up all the CORS settings in the Spring boot API. When I try with Postmen (normal request and OPTIONS) everything works. It is just not working in a webbrowser.
I’ve tried connectivity by going into the bash of the front-end container, install curl and check if the other container can be reached. This is possible. I checked the network to see if the containers are in the same network.
Can someone provide me with the golden answer!
Thanks in advance!