From 36cdb196ecc79bf3ed40b78efc1ca4d8c0329e3e Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 11 Oct 2024 10:08:30 +0530 Subject: [PATCH] Add image for nitro-contracts --- .../compose/docker-compose-nitro-contracts.yml | 2 +- .../compose/docker-compose-nitro-rpc-client.yml | 2 +- .../container-build/cerc-go-nitro/Dockerfile | 8 ++++---- .../container-build/cerc-nitro-client/Dockerfile | 2 +- .../container-build/cerc-nitro-contracts/Dockerfile | 10 ++++++++++ .../container-build/cerc-nitro-contracts/build.sh | 9 +++++++++ stack-orchestrator/stacks/nitro-contracts/stack.yml | 2 +- 7 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile create mode 100755 stack-orchestrator/container-build/cerc-nitro-contracts/build.sh diff --git a/stack-orchestrator/compose/docker-compose-nitro-contracts.yml b/stack-orchestrator/compose/docker-compose-nitro-contracts.yml index 796357f..bab3d8a 100644 --- a/stack-orchestrator/compose/docker-compose-nitro-contracts.yml +++ b/stack-orchestrator/compose/docker-compose-nitro-contracts.yml @@ -3,7 +3,7 @@ name: nitro-contracts services: # Optionally deploys the Nitro contracts nitro-contracts: - image: cerc/nitro-client:local + image: cerc/nitro-contracts:local restart: on-failure environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} diff --git a/stack-orchestrator/compose/docker-compose-nitro-rpc-client.yml b/stack-orchestrator/compose/docker-compose-nitro-rpc-client.yml index df4d118..4e64070 100644 --- a/stack-orchestrator/compose/docker-compose-nitro-rpc-client.yml +++ b/stack-orchestrator/compose/docker-compose-nitro-rpc-client.yml @@ -9,7 +9,7 @@ services: NODE_EXTRA_CA_CERTS: "/app/mkcert-caroot/rootCA.pem" command: ["bash", "-c", "tail -f /dev/null"] healthcheck: - test: ["CMD-SHELL", "nitro-rpc-client --version -p 4005"] + test: ["CMD-SHELL", "nitro-cli --version -p 4005"] interval: 30s timeout: 5s retries: 10 diff --git a/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile b/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile index 96b0b9d..a695373 100644 --- a/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile +++ b/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile @@ -1,7 +1,7 @@ -FROM debian:bullseye-slim +FROM ubuntu:latest RUN apt-get update -RUN apt-get install -y jq netcat ca-certificates curl +RUN apt-get install -y jq netcat-traditional ca-certificates curl RUN rm -rf /var/lib/apt/lists/* # Copy files into image @@ -13,8 +13,8 @@ RUN chmod +x mkcert-v*-linux-amd64 RUN cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert # Download binaries -RUN curl -LO https://3a54-14-140-185-65.ngrok-free.app/cerc-io/nitro/releases/download/latest/nitro -RUN curl -LO https://3a54-14-140-185-65.ngrok-free.app/cerc-io/nitro/releases/download/latest/bridge +RUN curl -LO https://git.vdb.to/cerc-io/nitro/releases/download/latest/nitro +RUN curl -LO https://git.vdb.to/cerc-io/nitro/releases/download/latest/bridge # Make binaries executable RUN chmod +x ./nitro diff --git a/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile b/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile index ef0f957..50bca80 100644 --- a/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile +++ b/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile @@ -4,7 +4,7 @@ RUN apk --update --no-cache add python3 alpine-sdk bash curl jq WORKDIR /app -RUN npm config set @cerc-io:registry https://3a54-14-140-185-65.ngrok-free.app/api/packages/cerc-io/npm/ +RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/ RUN echo "Installing nitro-rpc-client" && \ npm install -g @cerc-io/nitro-rpc-client diff --git a/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile b/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile new file mode 100644 index 0000000..5fe2df7 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile @@ -0,0 +1,10 @@ +FROM node:18.17.1-alpine3.18 + +RUN apk --update --no-cache add python3 alpine-sdk bash curl jq + +WORKDIR /app + +COPY . . + +RUN echo "Installing dependencies" && \ + yarn && yarn build diff --git a/stack-orchestrator/container-build/cerc-nitro-contracts/build.sh b/stack-orchestrator/container-build/cerc-nitro-contracts/build.sh new file mode 100755 index 0000000..e70c7d0 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-nitro-contracts/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Build cerc/nitro-contracts + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/nitro-contracts:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/go-nitro diff --git a/stack-orchestrator/stacks/nitro-contracts/stack.yml b/stack-orchestrator/stacks/nitro-contracts/stack.yml index ece621d..4938465 100644 --- a/stack-orchestrator/stacks/nitro-contracts/stack.yml +++ b/stack-orchestrator/stacks/nitro-contracts/stack.yml @@ -4,6 +4,6 @@ description: "Deploy nitro contracts" repos: - github.com/cerc-io/go-nitro containers: - - cerc/nitro-client + - cerc/nitro-contracts pods: - nitro-contracts