使用sequelize连接到现有的docker postgres容器

时间:2020-08-06 14:46:02

标签: postgresql docker sequelize.js

我有一个现有的postgres容器,可以正常工作。我现在尝试通过适当的迁移和模型来遵循Sequelize的最佳实践。 我启动了包含postgres数据库的docker容器:

Starting postgres-express-docker_postgres_1 ... done
Attaching to postgres-express-docker_postgres_1
postgres_1  |
postgres_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1  |
postgres_1  | 2020-08-06 14:43:59.373 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
postgres_1  | 2020-08-06 14:43:59.373 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1  | 2020-08-06 14:43:59.373 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1  | 2020-08-06 14:43:59.376 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1  | 2020-08-06 14:43:59.388 UTC [27] LOG:  database system was shut down at 2020-08-06 14:43:54 UTC
postgres_1  | 2020-08-06 14:43:59.393 UTC [1] LOG:  database system is ready to accept connections

然后,当我尝试运行sequelize db:migrate以运行构建的迁移时,我得到:

ERROR: getaddrinfo ENOTFOUND 0.0.0.0:5432

我在这里想念什么? sequelize Config指向相同的地址... 预先感谢

0 个答案:

没有答案