docker / awesome-compose

Awesome Docker Compose samples
https://docs.docker.com/compose/
Creative Commons Zero v1.0 Universal
35.05k stars 6.69k forks source link

I used react-java-mysql as base project and added react-express-mysql backend only #95

Open waghuldetejas opened 4 years ago

waghuldetejas commented 4 years ago

This is not issue! Help Required!

@glours @jdrouet @aiordache

I have to combine java-mysql and express-mysql in one react app . Java-mysql working fine as it uses 8080 port but unfortunately express-mysql does not seems to be work ,

Please refer below docker-compose file docker-compose.txt

backend-java uses db-mysql-java backend-node uses db-mysql-node

in backend-node port 80 replaced by 8086:8085 still can not able to access node api in react project
setup proxy contains code

module.exports = function(app) {
  app.use(
    "/api-java",
    createProxyMiddleware({
      target: "http://backend-java:8080",       // it works fine
      pathRewrite: { "^/api-java": "" }
    })
  );

  app.use(
    "/api-node",
    createProxyMiddleware({
      target: "http://backend-node:8085",    // it does not work 
      pathRewrite: { "^/api-node": "" }
    })
  );
};

which configuration i have to override in this scenario? Please help me!

waghuldetejas commented 4 years ago

@glours @jdrouet Please Help me !

waghuldetejas commented 4 years ago

Please find full code to rectify exact port problem.

react-java-express-mysql.zip

jdrouet commented 4 years ago

Hi @waghuldetejas,

I'm not working for Docker anymore, but I think, if you want such information/help, I encourage you to join the slack community ;)