I am trying to run a Node.js app in docker. I am using WSL and have created docker images for the Node.js app, MySQL, and PhpMyAdmin. Now when I run the Node.js app I am getting the error Error: connect ECONNREFUSED 127.0.0.1:3306
. Is it because MySQL is running on a different image? Is it possible to connect with MySQL on the wamp server? I have followed the tutorial here for containerizing MySQL. For running Node.js I am using the following command.
docker build -t gdns/node-app .
winpty docker run \
-it \
--rm \
-v ${PWD}:/app \
-v /app/node_modules \
-p 4001:4000 \
-e CHOKIDAR_USEPOLLING=true \
gdns/node-app
Please help.