我尝试使用以下命令在Mac上运行Hasura docker容器:-
docker run -d -p 8080:8080 \
-e HASURA_GRAPHQL_DATABASE_URL=postgres://username:password@host.docker.internal:5432/dbname \
-e HASURA_GRAPHQL_ENABLE_CONSOLE=true \
hasura/graphql-engine:latest
容器退出,出现以下错误
{"type":"pg-client","timestamp":"2020-06-17T06:09:42.825+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
{"type":"pg-client","timestamp":"2020-06-17T06:09:42.825+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
{"type":"startup","timestamp":"2020-06-17T06:09:42.825+0000","level":"error","detail":{"kind":"db_migrate","info":{"internal":"no connection to the server\n","path":"$","error":"connection error","code":"postgres-error"}}}
但是最初我遇到了权限相关的错误 届时,用户将没有权限创建pgcrypto扩展名,而该权限将已正确连接到Postgres。
启用pgcrypto扩展后,它无法连接到Postgres。