diff --git a/docker-compose.yml b/docker-compose.yml index 5c229e7e9..33792d2c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: ports: - ${RELAYER_1_API_SERVER_HOST:-0.0.0.0}:${RELAYER_1_API_SERVER_PORT:-3000}:${RELAYER_1_API_SERVER_PORT:-3000} healthcheck: - test: curl --fail http://relayer_1:${RELAYER_1_API_SERVER_PORT:-3000}/healthz + test: echo $$(wget --server-response http://relayer_1:${RELAYER_1_API_SERVER_PORT:-3000}/healthz 2>&1 | grep '200 OK') | grep '200' || exit 1 extra_hosts: - "host.docker.internal:host-gateway" diff --git a/scripts/lisk/docker/dev/composeStart.sh b/scripts/lisk/docker/dev/composeStart.sh index 99fd645f3..6cffc47d6 100644 --- a/scripts/lisk/docker/dev/composeStart.sh +++ b/scripts/lisk/docker/dev/composeStart.sh @@ -14,5 +14,4 @@ mkdir -p $PWD/.aws cp $HOME/.aws/credentials $PWD/.aws/ git apply scripts/lisk/docker/dev/docker-compose-dev.patch -aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${AWS_ECR_REGISTRY} -docker compose up --pull always --detach +docker compose up --pull always --build --detach diff --git a/scripts/lisk/docker/dev/docker-compose-dev.patch b/scripts/lisk/docker/dev/docker-compose-dev.patch index 2296575d5..5c22877ed 100644 --- a/scripts/lisk/docker/dev/docker-compose-dev.patch +++ b/scripts/lisk/docker/dev/docker-compose-dev.patch @@ -1,13 +1,21 @@ diff --git a/docker-compose.yml b/docker-compose.yml -index 5c229e7e..c4177aaf 100644 +index 33792d2c..556ba0cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml -@@ -21,17 +21,18 @@ services: +@@ -15,23 +15,24 @@ services: + retries: 3 + + relayer_1: +- image: ${AWS_ECR_REGISTRY}/${AWS_ECR_REPOSITORY}:${ACROSS_RELAYER_IMAGE_TAG} ++ build: . + platform: linux/amd64 + depends_on: redis: condition: service_healthy volumes: +- - ./scripts/lisk/docker/${NETWORK:-mainnet}/containerStartBot_1.sh:/home/lisk/across-relayer/scripts/start.sh + - ./.aws/credentials:/home/lisk/.aws/credentials - - ./scripts/lisk/docker/${NETWORK:-mainnet}/containerStartBot_1.sh:/home/lisk/across-relayer/scripts/start.sh ++ - ./scripts/lisk/docker/${NETWORK:-sepolia}/containerStartBot_1.sh:/home/lisk/across-relayer/scripts/start.sh networks: - across_relayer_network restart: always diff --git a/scripts/lisk/docker/mainnet/containerStartBot_1.sh b/scripts/lisk/docker/mainnet/containerStartBot_1.sh index 600bb073a..6e60747a9 100644 --- a/scripts/lisk/docker/mainnet/containerStartBot_1.sh +++ b/scripts/lisk/docker/mainnet/containerStartBot_1.sh @@ -28,6 +28,12 @@ echo "RPC_PROVIDER_DRPC_1135=$RPC_PROVIDER_DRPC_1135" >> ${env_file} RPC_PROVIDER_GELATO_1135=`echo $RELAYER_CONFIG | jq -r ."RPC_PROVIDER_GELATO_1135"` echo "RPC_PROVIDER_GELATO_1135=$RPC_PROVIDER_GELATO_1135" >> ${env_file} +API_SERVER_HOST=`echo $RELAYER_CONFIG | jq -r ."RELAYER_1_API_SERVER_HOST"` +echo "API_SERVER_HOST=$API_SERVER_HOST" >> ${app_dir}/.env + +API_SERVER_PORT=`echo $RELAYER_CONFIG | jq -r ."RELAYER_1_API_SERVER_PORT"` +echo "API_SERVER_PORT=$API_SERVER_PORT" >> ${app_dir}/.env + SLACK_CONFIG=`echo $RELAYER_CONFIG | jq -r ."SLACK_CONFIG"` echo "SLACK_CONFIG=$SLACK_CONFIG" >> ${env_file} diff --git a/scripts/lisk/docker/sepolia/containerStartBot_1.sh b/scripts/lisk/docker/sepolia/containerStartBot_1.sh index e85ab8683..2e84d12d8 100644 --- a/scripts/lisk/docker/sepolia/containerStartBot_1.sh +++ b/scripts/lisk/docker/sepolia/containerStartBot_1.sh @@ -31,6 +31,12 @@ echo "RPC_PROVIDER_GELATO_4202=$RPC_PROVIDER_GELATO_4202" >> ${env_file} HUB_CHAIN_ID=`echo $RELAYER_CONFIG | jq -r ."HUB_CHAIN_ID"` echo "HUB_CHAIN_ID=$HUB_CHAIN_ID" >> ${env_file} +API_SERVER_HOST=`echo $RELAYER_CONFIG | jq -r ."RELAYER_1_API_SERVER_HOST"` +echo "API_SERVER_HOST=$API_SERVER_HOST" >> ${app_dir}/.env + +API_SERVER_PORT=`echo $RELAYER_CONFIG | jq -r ."RELAYER_1_API_SERVER_PORT"` +echo "API_SERVER_PORT=$API_SERVER_PORT" >> ${app_dir}/.env + echo "All env vars from secrets are set." # Set the bot identifier diff --git a/src/api/server.ts b/src/api/server.ts index 7b33342fd..dd4249332 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -7,7 +7,7 @@ dotenv.config(); export function runAPIServer(logger: winston.Logger): void { const app: Express = express(); - const host = process.env.API_SERVER_HOST || "127.0.0.1"; + const host = process.env.API_SERVER_HOST || "0.0.0.0"; const port = Number(process.env.API_SERVER_PORT) || 3000; app.use("/healthz", healthz());