I’m running web app and postgres in docker containers inside VM and every once in a little while postgres docker resets user password but data remains. This makes application fails calling postgres db. I’d have to access ssh and run ALTER USER postgres WITH PASSWORD ‘postgres’; to fix it every time them it’d run fine for a day or two sometimes more.
Here is the log before the error occurs:
https://imgur.com/FxwiDMY
Has anyone seen any similar problems or any idea what’s going on?
My docker-compose.yml :
version: '3.4'
services:
postgres:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
volumes:
- db-data:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
redis:
...
web:
...
volumes:
db-data:
driver: local
EDIT: I copied wording from here since this was exactly the same problem I am facing. https://www.digitalocean.com/community/questions/postgres-docker-in-droplet-resets-user-password-on-its-own
I’m running web app and postgres in docker containers inside VM and every once in a little while postgres docker resets user password but data remains. This makes application fails calling postgres db. I’d have to access ssh and run
ALTER USER postgres WITH PASSWORD ‘postgres’;to fix it every time them it’d run fine for a day or two sometimes more.Here is the log before the error occurs:
https://imgur.com/FxwiDMY
Has anyone seen any similar problems or any idea what’s going on?
My
docker-compose.yml:EDIT: I copied wording from here since this was exactly the same problem I am facing. https://www.digitalocean.com/community/questions/postgres-docker-in-droplet-resets-user-password-on-its-own