Hi all, I’ve configured nginx and postgresql on host and vaultwarden with docker-compose.
I had to use docker host-ip 172.18.0.1 to connect to database as I couldn’t make it work otherways so my env variable looks like this postgresql://login:pass@172.18.0.1:5432/vaultwarden
And my reverse-proxy config is pretty simple: just proxy_pass’ing all to 127.0.0.1:8088 port exposed in compose file.
So good so far but I have some problems here - vaultwarden can be accessed by its external IP:8088 address, so I decided to remove all access to docker container from other than host machines. But how should I do it properly? I’ve tried to set ports in compose file from 8088:80 to 127.0.0.1:8080:80 and got stuck on a new problem - vaultwarden could not connect to postgres anymore and launched sqlite instead.
So I’ve tried to set network_mode to “host” and changed DATABASE_URL ip to localhost, but it didn’t help.
Moreover I can’t find any logs regarding the database connection and why it’s failing. I’ve tried to enable Extended_logging and set log_level to trace but still.
DB check like pg_isready -d vaultwarden -h 127.0.0.1 -p 5432 -U user
is ok, so DB should be available.
What am I doing wrong? And how can I view some logs for DB connection?