Skip to content

Commit

Permalink
chore: 🤖 add create btree_gist extension for postgres
Browse files Browse the repository at this point in the history
add needed subquery extension to the DB
  • Loading branch information
polymath-eric committed Jun 25, 2024
1 parent 3480549 commit 7349ebd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions compose/init-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 12 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:

0 comments on commit 7349ebd

Please sign in to comment.