在构建docker容器之前,我正在本地处理Webhook,并希望我的(Linux)容器使用host.docker.internal:ping
与之通信。
它以前一直在工作,但是最近,由于某种原因,我从我们的graphql-engine
Hasura那里得到了这个错误:
{
"timestamp":"2019-11-05T18:45:32.860+0000","level":"error","type":"webhook-log","detail":{
"response":null,"url":"http://host.docker.internal:3000/simple/webhook","method":"GET","http_error":{
"type":"http_exception","message":"ConnectionFailure Network.Socket.getaddrInfo (called with preferred socket type/protocol: AddrInfo {addrflags = [AI_ADDRCONFIG],addrFamily = AF_UNSPEC,addrSocketType = Stream,addrProtocol = 0,addrAddress = <assumed to be undefined>,addrCanonName = <assumed to be undefined>},host name: Just \"host.docker.internal\",service name: Just \"3000\"): does not exist (Temporary failure in name resolution)"
},"status_code":null
}
}
这是我的码头工人组成:
version: '3.6'
services:
postgres:
image: postgres:11.2
restart: always
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=...
- POSTGRES_PASSWORD=...
graphql-engine:
image: hasura/graphql-engine:latest
depends_on:
- postgres
restart: always
environment:
- HASURA_GRAPHQL_DATABASE_URL=postgres://...:...@postgres:5432/postgres
- HASURA_GRAPHQL_accESS_KEY=...
- HASURA_GRAPHQL_AUTH_HOOK=http://host.docker.internal:3000/simple/webhook
command:
- graphql-engine
- serve
- --enable-console
ports:
- 8080:8080
volumes:
postgres:
data:
本地项目肯定可以正常工作,并且正在侦听端口3000。但是,它没有从graphql-engine容器接收任何请求(应有)。可能与我们的代理有关吗?