#Expose a port to a server
1 messages · Page 1 of 1 (latest)
This may help you, but it doesn't get very specific. It would let your server view ALL other ports on the network.
No point in getting more specific in suggesting solutions until you state what firewall you use; too many possibilities otherwise.
Im using UFW forgot to add that in there
I believe it would be this, but I'm not 100% sure:
sudo ufw allow from 172.18.0.1 to any port 5050
Would i still use localhost:5050 to access it or has the hostname changed?
I believe it would be 0.0.0.0:5050 to access it from the container. I don't remember if localhost was 0.0.0.0 or the more restrictive 127.0.0.1
localhost would probably work
I dont think i have any luck, doesnt seem to work. I wonder if i have to docker expose the ports or something
What is your node's allocation?
If it's 127.0.0.1 it's isolated and you could try 0.0.0.0 or 172.18.0.1
Also your database's user, is it configured to access connections from everywhere (%) or your containers (172.18.0.1)?
I might have gotten the wrong command here, you could also try sudo ufw allow from 172.18.0.0/16 to any port 5050
---------[ERROR]---------
connect ECONNREFUSED 127.0.0.1:5050
---------[ERROR]---------
connect ECONNREFUSED 172.18.0.1:5050
---------[ERROR]---------
connect ECONNREFUSED 0.0.0.0:5050
sudo ufw allow from 172.18.0.0/16 to any port 5050
The database's user is fine
after doing this but using the ip of the server xxx.xxx.xxx.xxx it worked, Not the local ones though