I'm trying to run a full stack application of React JS and Spring Boot in my docker environment. Locally everything works fine. But inside the docker environment, the react js and spring boot application both starts. But I'm getting a connection refused error when I'm trying to establish communication between react and spring boot.
I've added a ProxyPass in my apache2 config file inside the docker environment as follows :-
ProxyPass /app-name/ http://0.0.0.0:9090/
Error :- OPTIONS http://localhost:8080/login net::ERR_CONNECTION_REFUSED
.
Docker commands used :-
Docker command to build the docker image :-
docker build --rm -t <image-name>.
I've exposed the ports required in the docker run command as follows :-
docker run --rm -p 5050:8080 -p 6060:3000 --name <container-name> <image-name>
Docker command to exec inside the container :-
docker exec -it <container-name> /bin/bash
Inside the docker environment, I started the spring boot application using
mvn spring-boot:run
and started the react application using yarn install
followed by yarn start
How do I solve the connection refused error here?