Hi. We currently testing docker for for our business. What we want is to have our web application running in a docker container and our databases should be outside the docker container. We are testing with docker compose and one node application in one container linked to redis server in another container. What we cant figure out is how to get access to our mysql server outside the docker node js container.
like a normal multi-system mysql you need
enable the mysql server to allow remote connections
enable the USER to connect from that (or any) system for that database (at the server)
in the application m use the ip address of the mysql server in the connection string
you probably won’t be able to use its normal DNS system name, but you could add that to the container startup with the rdocker run --add-host name:ipaddress parameter