From 7349ebda00df7f4a074985340eeedaffba13cc8f Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Tue, 25 Jun 2024 12:46:51 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20create=20btree=5F?= =?UTF-8?q?gist=20extension=20for=20postgres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add needed subquery extension to the DB --- compose/init-db.sh | 1 + docker-compose.yml | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/compose/init-db.sh b/compose/init-db.sh index 274e89dc..64909d23 100755 --- a/compose/init-db.sh +++ b/compose/init-db.sh @@ -2,6 +2,7 @@ set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE EXTENSION IF NOT EXISTS btree_gist; SELECT 'CREATE DATABASE rest' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'rest')\gexec EOSQL \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a4d91cdb..1e9c8e02 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,9 +16,9 @@ services: command: [ '--alice --chain dev' ] healthcheck: test: "timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9933' && exit 0 || exit 1" - interval: 10s + interval: 5s timeout: 5s - retries: 10 + retries: 20 start_period: 10s subquery: @@ -27,7 +27,10 @@ services: init: true restart: unless-stopped depends_on: - - 'postgres' + postgres: + condition: service_started + chain: + condition: service_healthy environment: START_BLOCK: 1 NETWORK_ENDPOINT: ws://chain:9944 @@ -44,13 +47,13 @@ services: - --local healthcheck: test: curl --fail http://localhost:3000/meta || exit 1 - interval: 20s - retries: 10 + interval: 10s + retries: 20 start_period: 20s timeout: 10s graphql: - image: onfinality/subql-query:v1.0.0 + image: onfinality/subql-query:v2.13.0 restart: unless-stopped ports: - ${SQ_PORT:-3001}:3000 @@ -95,9 +98,9 @@ services: POSTGRES_PASSWORD: $REST_POSTGRES_PASSWORD healthcheck: test: [ 'CMD-SHELL', 'pg_isready -U postgres' ] - interval: 5s - timeout: 5s - retries: 5 + interval: 3s + timeout: 3s + retries: 10 volumes: db-data: