Where’s this 2nd DB located? Is it inside or outside Docker?
Each Docker container only runs one service. So, the NodeJS container only runs NodeJS, there’s nothing else running at localhost, so you cannot connect to a database running on localhost.
When Wappler creates a NodeJS and Database inside Docker, those are two containers. The NodeJS doesn’t talk to “localhost”, it talks to “db” (which is DNS resolved to the container’s IP address that runs the database)
Are you running this database inside Docker? If yes, they you most likely modified the docker-compose file (e.g.: added a service called “db2”), so you use “db2” instead of localhost.
Are you running this database outside Docker? If yes, this is a more difficult scenario as it depends if you’re running Windows/MacOS/Linux, there are different methods to connect from a container to the host system. If possible, I suggest running everything inside Docker for simplification purposes
You can edit the docker-compose.yml file in your project folder, e.g.:
.wappler/targets/Development/docker-compose.yml