diff --git a/.docker/hasura.Dockerfile b/.docker/hasura.Dockerfile index 9ad685b..576085b 100644 --- a/.docker/hasura.Dockerfile +++ b/.docker/hasura.Dockerfile @@ -1,3 +1,4 @@ -FROM hasura/graphql-engine:latest +FROM hasura/graphql-engine:latest.cli-migrations-v3 WORKDIR /hasura RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash +RUN apt install postgresql-client \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 6c3f489..07e72ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,11 @@ services: POSTGRES_USER: seeds POSTGRES_PASSWORD: password POSTGRES_HOST_AUTH_METHOD: trust + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 10s + timeout: 5s + retries: 5 seeds_api: build: ./api @@ -33,10 +38,15 @@ services: volumes: - ./hasura:/hasura environment: + HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura/migrations + HASURA_GRAPHQL_METADATA_DIR: /hasura/metadata HASURA_GRAPHQL_ENABLE_CONSOLE: "true" HASURA_GRAPHQL_DATABASE_URL: postgres://seeds:password@seeds_db:5432/myapp_development HASURA_GRAPHQL_DEV_MODE: "true" HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log + depends_on: + seeds_db: + condition: service_healthy seeds_view: build: ./view