I'm trying to connect to a database via SSH from my docker container. I'm getting an error
could not connect to server: Connection refused
Is the server running on host "0.0.0.0" and accepting
TCP/IP connections on port 5433?
I have a script to open the port and it works fine on my development, OSX Catalina.
bin/tunnel.sh
#!/usr/bin/expect -f
spawn ssh -fNg -L 5432:0.0.0.0:5432 myserver
expect "connecting"
send "yes"
expect "assword:"
send "mypassword\r"
interact
ENTRYPOINT
set -e
if [ -f tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
service cron restart
./bin/tunnel.sh
foreman start -f Procfile.production web
database.yml
production: &production
<<: *default
# sslmode: "require"
host: 0.0.0.0
# pool: 100