diff --git a/services/ir/.ir.env b/services/ir/.ir.env index 7fa1f25..023b4ac 100644 --- a/services/ir/.ir.env +++ b/services/ir/.ir.env @@ -56,3 +56,5 @@ NEOFS_IR_SETTLEMENT_BASIC_INCOME_RATE=100000000 NEOFS_IR_SETTLEMENT_AUDIT_FEE=100000 NEOFS_IR_LOCODE_DB_PATH=/locode/db + +NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512 diff --git a/services/ir/docker-compose.yml b/services/ir/docker-compose.yml index cb45217..feb24de 100644 --- a/services/ir/docker-compose.yml +++ b/services/ir/docker-compose.yml @@ -16,13 +16,29 @@ services: stop_signal: SIGKILL volumes: - ./wallet01.json:/wallet.json + - ./wallet01.key:/wallet01.key - ./../../vendor/hosts:/etc/hosts - ./../../vendor/locode_db:/locode/db + - ./../../vendor/neofs-cli:/neofs-cli + - ./healthcheck.sh:/healthcheck.sh env_file: [ ".env", ".ir.env" ] environment: - NEOFS_IR_WALLET_PATH=/wallet.json - NEOFS_IR_WALLET_ADDRESS=Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn - NEOFS_IR_WALLET_PASSWORD=one + healthcheck: + test: ["CMD-SHELL", "/healthcheck.sh"] + interval: 2s + timeout: 1s + retries: 5 + start_period: 20s + + ir-healthcheck: + container_name: ir-healthcheck + image: debian:10 + depends_on: + ir01: + condition: service_healthy networks: ir_int: diff --git a/services/ir/healthcheck.sh b/services/ir/healthcheck.sh new file mode 100755 index 0000000..30bbfd4 --- /dev/null +++ b/services/ir/healthcheck.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +EXPECTED="Health status: READY" +GOT=`/neofs-cli -r $NEOFS_IR_CONTROL_GRPC_ENDPOINT --binary-key /wallet01.key control healthcheck --ir | grep Health` +if [ "$EXPECTED" = "$GOT" ]; then exit 0; else exit 1; fi diff --git a/services/ir/wallet01.key b/services/ir/wallet01.key new file mode 100644 index 0000000..e471144 --- /dev/null +++ b/services/ir/wallet01.key @@ -0,0 +1 @@ +4{½ž·¹ô!z&ÜZ=*<%ìáÈ¿ñÕ¡Fªôn46 \ No newline at end of file