Skip to content

Commit

Permalink
fix and docker compose rightsizing-compose up
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayurii committed Jul 12, 2024
1 parent 499129a commit ee8f38e
Showing 1 changed file with 44 additions and 91 deletions.
135 changes: 44 additions & 91 deletions examples/rightsizing-compose.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,79 @@
version: '3.7'

x-common-variables: &common-variables
CHAIN_ID: mainnet
REDIS_URL: redis://redis:6379/
META_DATABASE_URL: postgres://postgres:password@localhost:5422/near_data
SHARD_0_DATABASE_URL: postgres://postgres:password@localhost:5430/near_data
SHARD_1_DATABASE_URL: postgres://postgres:password@localhost:5431/near_data
SHARD_2_DATABASE_URL: postgres://postgres:password@localhost:5432/near_data
SHARD_3_DATABASE_URL: postgres://postgres:password@localhost:5433/near_data
SHARD_4_DATABASE_URL: postgres://postgres:password@localhost:5434/near_data
SHARD_5_DATABASE_URL: postgres://postgres:password@localhost:5435/near_data
META_DATABASE_URL: postgres://postgres:password@metadata_db:5432/near_data
SHARD_0_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
SHARD_1_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
SHARD_2_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
SHARD_3_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
SHARD_4_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
SHARD_5_DATABASE_URL: postgres://postgres:password@shard_db:5432/near_data
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
TRACKED_ACCOUNTS: '["social.near"]'

NEAR_RPC_URL: https://rpc.mainnet.near.org
ARCHIVAL_NEAR_RPC_URL: https://archival-rpc.mainnet.near.org
AWS_BUCKET_NAME: near-lake-data-mainnet
RUST_LOG: "info"
TRACKED_ACCOUNTS: '["social.near"]'

services:
rpc-server:
build:
context: ../
context: .
dockerfile: rpc-server/Dockerfile
args:
profile: "dev-release"
environment:
<<: *common-variables
SERVER_PORT: 8000
TX_BUCKET_NAME: near-tx-local
STORAGE_EMULATOR_HOST: http://gcs_emulator:9023
RUST_LOG: "info"
restart: on-failure
ports:
- "8000:8000"
- "8080:8080"
depends_on:
- gcs_emulator
- metadata_db
- shard_0_db
- shard_1_db
- shard_2_db
- shard_3_db
- shard_4_db
- shard_5_db
- redis
- shard_db

state-indexer:
build:
context: ../
context: .
dockerfile: state-indexer/Dockerfile
args:
profile: "dev-release"
environment:
<<: *common-variables
STATE_INDEXER_ID: state-indexer-local
RUST_LOG: "info"
command: [ "from-interruption" ]
ports:
- "8080:8080"
- "8081:8081"
depends_on:
- metadata_db
- shard_0_db
- shard_1_db
- shard_2_db
- shard_3_db
- shard_4_db
- shard_5_db
- redis
- shard_db
restart: on-failure

tx-indexer:
build:
context: ../
context: .
dockerfile: tx-indexer/Dockerfile
args:
profile: "dev-release"
environment:
<<: *common-variables
REDIS_URL: redis://redis:6379/
TX_INDEXER_ID: tx-indexer-local
TX_BUCKET_NAME: near-tx-local
STORAGE_EMULATOR_HOST: http://gcs_emulator:9023
RUST_LOG: "info"
command: [ "from-interruption" ]
ports:
- "8081:8081"
- "8082:8082"
depends_on:
- gcs_emulator
- metadata_db
- shard_0_db
- shard_1_db
- shard_2_db
- shard_3_db
- shard_4_db
- shard_5_db
- redis
- shard_db
restart: on-failure

redis:
Expand All @@ -90,72 +83,32 @@ services:
- "6379:6379"
restart: always

metadata_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5422:5432"

shard_0_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5430:5432"

shard_1_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5431:5432"

shard_2_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
gcs_emulator:
image: oittaa/gcp-storage-emulator:latest
restart: on-failure
entrypoint: ["/bin/sh","-c"]
command: ["gcp-storage-emulator create_bucket near-tx-local && gcp-storage-emulator start"]
ports:
- "5432:5432"

shard_3_db:
image: postgres:15.5
restart: always
- "9023:9023"
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5433:5432"
PORT: 9023

shard_4_db:
metadata_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5434:5432"
- "5422:5432"

shard_5_db:
shard_db:
image: postgres:15.5
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_DB: near_data
POSTGRES_PASSWORD: password
ports:
- "5435:5432"
- "5430:5432"

0 comments on commit ee8f38e

Please sign in to comment.