Skip to content

Commit 7349ebd

Browse files
committed
chore: 🤖 add create btree_gist extension for postgres
add needed subquery extension to the DB
1 parent 3480549 commit 7349ebd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

‎compose/init-db.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -e
33

44
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
5+
CREATE EXTENSION IF NOT EXISTS btree_gist;
56
SELECT 'CREATE DATABASE rest'
67
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'rest')\gexec
78
EOSQL

‎docker-compose.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ services:
1616
command: [ '--alice --chain dev' ]
1717
healthcheck:
1818
test: "timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9933' && exit 0 || exit 1"
19-
interval: 10s
19+
interval: 5s
2020
timeout: 5s
21-
retries: 10
21+
retries: 20
2222
start_period: 10s
2323

2424
subquery:
@@ -27,7 +27,10 @@ services:
2727
init: true
2828
restart: unless-stopped
2929
depends_on:
30-
- 'postgres'
30+
postgres:
31+
condition: service_started
32+
chain:
33+
condition: service_healthy
3134
environment:
3235
START_BLOCK: 1
3336
NETWORK_ENDPOINT: ws://chain:9944
@@ -44,13 +47,13 @@ services:
4447
- --local
4548
healthcheck:
4649
test: curl --fail http://localhost:3000/meta || exit 1
47-
interval: 20s
48-
retries: 10
50+
interval: 10s
51+
retries: 20
4952
start_period: 20s
5053
timeout: 10s
5154

5255
graphql:
53-
image: onfinality/subql-query:v1.0.0
56+
image: onfinality/subql-query:v2.13.0
5457
restart: unless-stopped
5558
ports:
5659
- ${SQ_PORT:-3001}:3000
@@ -95,9 +98,9 @@ services:
9598
POSTGRES_PASSWORD: $REST_POSTGRES_PASSWORD
9699
healthcheck:
97100
test: [ 'CMD-SHELL', 'pg_isready -U postgres' ]
98-
interval: 5s
99-
timeout: 5s
100-
retries: 5
101+
interval: 3s
102+
timeout: 3s
103+
retries: 10
101104

102105
volumes:
103106
db-data:

0 commit comments

Comments
 (0)