diff --git a/docker-compose.yml b/docker-compose.yml index 798a230559..83c44d51dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,6 +65,7 @@ services: container_name: indexer_container environment: DATABASE_URL: postgres://postgres:password@localhost:5432/indexer + ROOT_DATABASE_URL: postgres://postgres:password@localhost:5432/postgres REGEN_API: http://127.0.0.1:1317 REGEN_RPC: http://127.0.0.1:26657 entrypoint: ["/bin/sh", "-c", "./scripts/indexer_start.sh"] diff --git a/docker/indexer.Dockerfile b/docker/indexer.Dockerfile index 5a6857a9d5..454c495235 100644 --- a/docker/indexer.Dockerfile +++ b/docker/indexer.Dockerfile @@ -1,11 +1,11 @@ -FROM python:3.9-slim +FROM python:3.9 # Install dependencies RUN apt-get update -RUN apt-get install git libpq-dev gcc postgresql-client -y +RUN apt-get install libpq-dev postgresql-client nodejs python3-poetry yarnpkg -y # Set version and chain -ENV GIT_CHECKOUT='8d3635aa33d4d49db903f947bb357c938d168f8d' +ENV GIT_CHECKOUT='07ba5fa054e34d2a0587daa944c8e517ff82ce18' # Clone regen ledger RUN git clone https://github.com/regen-network/indexer/ /home/indexer @@ -16,15 +16,9 @@ WORKDIR /home/indexer # Use provided version RUN git checkout $GIT_CHECKOUT -# Install python dependencies -RUN pip install poetry -RUN pip install load_dotenv -RUN pip install psycopg2 -RUN pip install sentry_sdk -RUN pip install tenacity - # Install indexer RUN poetry install +RUN yarnpkg install # Copy indexer init script COPY docker/scripts/indexer_init.sh /home/indexer/scripts/ diff --git a/docker/scripts/indexer_init.sh b/docker/scripts/indexer_init.sh index 7357e53b05..ab61e29c68 100755 --- a/docker/scripts/indexer_init.sh +++ b/docker/scripts/indexer_init.sh @@ -1,7 +1,7 @@ #!/bin/bash # run migrations -(cd sql && ./run_all_migrations.sh) +yarnpkg run db-init # workaround for indexer starting with new chain psql "$DATABASE_URL" -c "INSERT INTO chain ( diff --git a/docker/scripts/indexer_start.sh b/docker/scripts/indexer_start.sh index 8be213a6e5..12ad09ce13 100755 --- a/docker/scripts/indexer_start.sh +++ b/docker/scripts/indexer_start.sh @@ -15,4 +15,4 @@ if [ ! -e $INDEXER_INITIALIZED ]; then fi # start indexer -python main.py +poetry run python main.py