Add a local stack for ERC721 watcher (#81)

* Add a stack for erc721 watcher

* Add a demo

* Avoid watcher db service and volume name conflicts across watchers

* Avoid host port conflicts across watchers

* Avoid watcher-db port conflicts
This commit is contained in:
prathamesh0
2022-12-22 13:13:59 +05:30
committed by GitHub
parent a7221ddc24
commit 27c3efabe2
10 changed files with 369 additions and 10 deletions
+8 -8
View File
@@ -2,7 +2,7 @@ version: '3.2'
services:
watcher-db:
erc20-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
@@ -12,9 +12,9 @@ services:
- POSTGRES_PASSWORD=password
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- watcher_db_data:/var/lib/postgresql/data
- erc20_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15432:5432"
- "0.0.0.0:15433:5432"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
@@ -27,7 +27,7 @@ services:
depends_on:
ipld-eth-server:
condition: service_healthy
watcher-db:
erc20-watcher-db:
condition: service_healthy
image: cerc/watcher-erc20:local
environment:
@@ -36,14 +36,14 @@ services:
volumes:
- ../config/watcher-erc20/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
ports:
- "0.0.0.0:3001:3001"
- "0.0.0.0:9001:9001"
- "0.0.0.0:3002:3001"
- "0.0.0.0:9002:9001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3001"]
test: ["CMD", "nc", "-v", "localhost", "3002"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
volumes:
watcher_db_data:
erc20_watcher_db_data:
+49
View File
@@ -0,0 +1,49 @@
version: '3.2'
services:
erc721-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_MULTIPLE_DATABASES=erc721-watcher,erc721-watcher-job-queue
- POSTGRES_EXTENSION=erc721-watcher-job-queue:pgcrypto
- POSTGRES_PASSWORD=password
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- erc721_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15434:5432"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
erc721-watcher:
restart: unless-stopped
depends_on:
ipld-eth-server:
condition: service_healthy
erc721-watcher-db:
condition: service_healthy
image: cerc/watcher-erc721:local
environment:
- ETH_RPC_URL=http://go-ethereum:8545
command: ["sh", "-c", "yarn server"]
volumes:
- ../config/watcher-erc721/erc721-watcher.toml:/app/packages/erc721-watcher/environments/local.toml
ports:
- "0.0.0.0:3009:3009"
- "0.0.0.0:9003:9001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3009"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
volumes:
erc721_watcher_db_data: