我在虚拟机内部的docker容器中运行web app和postgres,并且postgres docker每隔一段时间会重置用户密码,但数据仍然保留。这会导致应用程序无法调用postgres db。每次我都必须访问ssh并运行ALTER USER postgres WITH PASSWORD ‘postgres’;来修复它,它可以正常运行一两天,甚至更长时间。我的docker-compose.yml: postgres
每次查询数据库时都需要使用pg.connect()吗?在查看了githhub页面和wiki之后,示例显示了一个类似于这样的pg.connect回调内部的查询(注释来自github示例,我没有编写它们)//it will keep idle connections open for a (configurable) 30 secondspg.connect(conString, function(err, client, done)
我写的Django项目与Postgres作为一个数据库,并想要停靠它。所以问题是:当我构建容器时,有一个例外:polls | Is the server running on host "postgres" (172.19.0.2) and accepting/code/version: '3'
postgres: