From b7b58b4aa5122ae53ca7e6af1bc85defa821cc59 Mon Sep 17 00:00:00 2001
From: librelois <c@elo.tf>
Date: Fri, 28 Jan 2022 01:46:15 +0100
Subject: [PATCH] doc: add a docker compose example to setup an hydra indexer

---
 .../hydra-indexer.docker-compose.yml          | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 docker/compose-examples/hydra-indexer.docker-compose.yml

diff --git a/docker/compose-examples/hydra-indexer.docker-compose.yml b/docker/compose-examples/hydra-indexer.docker-compose.yml
new file mode 100644
index 000000000..80afffb9e
--- /dev/null
+++ b/docker/compose-examples/hydra-indexer.docker-compose.yml
@@ -0,0 +1,71 @@
+version: "3.4"
+
+services:
+  db:
+    image: postgres:12
+    restart: always
+    volumes:
+      - /var/lib/postgresql/data
+    environment:
+      POSTGRES_USER: postgres
+      POSTGRES_PASSWORD: postgres
+
+  duniter-1:
+    image: duniter/duniter-v2s:debug-sha-c305faab
+    restart: unless-stopped
+    ports:
+      - "9944:9944"
+
+  indexer:
+    image: subsquid/hydra-indexer:5
+    restart: unless-stopped
+    environment:
+      - WORKERS_NUMBER=1
+      - DB_NAME=indexer
+      - DB_HOST=db
+      - DB_USER=postgres
+      - DB_PASS=postgres
+      - DB_PORT=5432
+      - REDIS_URI=redis://redis:6379/0
+      - FORCE_HEIGHT=true
+      - BLOCK_HEIGHT=0 # starting block height
+      - WS_PROVIDER_ENDPOINT_URI=ws://duniter-1:9944/
+    depends_on:
+      - db
+      - redis
+    command: >
+      sh -c "yarn db:bootstrap && yarn start:prod"
+
+  indexer-gateway:
+    image: subsquid/hydra-indexer-gateway:5
+    restart: unless-stopped
+    depends_on:
+      - redis
+      - db
+      - indexer-status-service
+      - indexer
+    ports:
+      - "4010:8080"
+    environment:
+      - DEV_MODE=true
+      - DB_NAME=indexer
+      - DB_HOST=db
+      - DB_USER=postgres
+      - DB_PASS=postgres
+      - DB_PORT=5432
+      - HYDRA_INDEXER_STATUS_SERVICE=http://indexer-status-service:8081/status
+
+  indexer-status-service:
+    image: subsquid/hydra-indexer-status-service:5
+    restart: unless-stopped
+    depends_on:
+      - redis
+    environment:
+      REDIS_URI: redis://redis:6379/0
+      PORT: 8081
+
+  redis:
+    image: redis:6.0-alpine
+    restart: always
+    ports:
+      - "6379"
-- 
GitLab