I am having some issues getting Hasura to connect to postgres.
The error error {"type":"pg-client","timestamp":"2021-08-02T05:04:50.035+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
after using docker-compose up
Here is my docker-compose.yml file.
services:
postgres:
image: postgis/postgis
container_name: db1
ports:
- "5432:5432"
restart: always
volumes:
- db_data:/var/lib/postgresql/data
graphql-engine:
image: hasura/graphql-engine:v2.0.1
container_name: hasura1
ports:
- "8080:8080"
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres@postgres:5432/postgres
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres@postgres:5432/postgres
## enable the console served by server
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
## enable debugging mode. It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: "true"
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET:
volumes:
db_data:
I am running Ubuntu 20.04.2 LTS Focal. The docker-compose file works on my mac but not on linux box.
I was able to get hasura to work on ubuntu, in case anyone is having an issue, you use network_mode: host and use localhost in the postgres string inside your docker-compose.yml file