From fab4358cd9a267ed7306be1fcb97949763961cf9 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 2 Oct 2023 12:47:25 +0530 Subject: [PATCH] Add a container and service for mobymask-snap --- app/data/compose/docker-compose-go-nitro.yml | 6 +++--- app/data/compose/docker-compose-mobymask-snap.yml | 14 ++++++++++++++ .../docker-compose-nitro-reverse-payment-proxy.yml | 6 +++--- .../container-build/cerc-mobymask-snap/Dockerfile | 13 +++++++++++++ .../container-build/cerc-mobymask-snap/build.sh | 7 +++++++ app/data/container-image-list.txt | 1 + app/data/pod-list.txt | 1 + app/data/repository-list.txt | 1 + app/data/stacks/fixturenet-payments/stack.yml | 5 +++++ 9 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 app/data/compose/docker-compose-mobymask-snap.yml create mode 100644 app/data/container-build/cerc-mobymask-snap/Dockerfile create mode 100755 app/data/container-build/cerc-mobymask-snap/build.sh diff --git a/app/data/compose/docker-compose-go-nitro.yml b/app/data/compose/docker-compose-go-nitro.yml index 77d7c973..b338f2e6 100644 --- a/app/data/compose/docker-compose-go-nitro.yml +++ b/app/data/compose/docker-compose-go-nitro.yml @@ -25,10 +25,10 @@ services: - ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh healthcheck: test: ["CMD", "nc", "-vz", "localhost", "4005"] - interval: 5s + interval: 10s timeout: 5s - retries: 5 - start_period: 5s + retries: 10 + start_period: 10s ports: - "3005" - "4005" diff --git a/app/data/compose/docker-compose-mobymask-snap.yml b/app/data/compose/docker-compose-mobymask-snap.yml new file mode 100644 index 00000000..d2cec254 --- /dev/null +++ b/app/data/compose/docker-compose-mobymask-snap.yml @@ -0,0 +1,14 @@ +version: '3.7' + +services: + mobymask-snap: + restart: unless-stopped + image: cerc/mobymask-snap:local + ports: + - "127.0.0.1:8080:8080" + healthcheck: + test: ["CMD", "nc", "-vz", "localhost", "8080"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 10s diff --git a/app/data/compose/docker-compose-nitro-reverse-payment-proxy.yml b/app/data/compose/docker-compose-nitro-reverse-payment-proxy.yml index e380f7cf..37f49407 100644 --- a/app/data/compose/docker-compose-nitro-reverse-payment-proxy.yml +++ b/app/data/compose/docker-compose-nitro-reverse-payment-proxy.yml @@ -19,9 +19,9 @@ services: - ../config/go-nitro/run-reverse-payment-proxy.sh:/app/run-reverse-payment-proxy.sh healthcheck: test: ["CMD", "nc", "-vz", "localhost", "8081"] - interval: 5s + interval: 10s timeout: 5s - retries: 5 - start_period: 5s + retries: 10 + start_period: 10s ports: - "8081:8081" diff --git a/app/data/container-build/cerc-mobymask-snap/Dockerfile b/app/data/container-build/cerc-mobymask-snap/Dockerfile new file mode 100644 index 00000000..f80969c3 --- /dev/null +++ b/app/data/container-build/cerc-mobymask-snap/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18.15.0-alpine3.16 + +RUN apk --update --no-cache add git python3 alpine-sdk bash + +WORKDIR /app + +COPY . . + +RUN echo "Installing dependencies..." && \ + yarn install && \ + cd packages/snap + +CMD ["bash", "-c", "yarn start"] diff --git a/app/data/container-build/cerc-mobymask-snap/build.sh b/app/data/container-build/cerc-mobymask-snap/build.sh new file mode 100755 index 00000000..c82f96ca --- /dev/null +++ b/app/data/container-build/cerc-mobymask-snap/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Build cerc/mobymask-snap + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/mobymask-snap:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/mobymask-snap diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index 761c9ed2..01a312ed 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -53,3 +53,4 @@ cerc/webapp-base cerc/watcher-mobymask-v3 cerc/go-nitro cerc/nitro-contracts +cerc/mobymask-snap diff --git a/app/data/pod-list.txt b/app/data/pod-list.txt index 563f32cc..236c72e0 100644 --- a/app/data/pod-list.txt +++ b/app/data/pod-list.txt @@ -40,3 +40,4 @@ mobymask-app-v3 go-nitro nitro-contracts nitro-reverse-payment-proxy +mobymask-snap diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 45845607..8952b919 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -45,3 +45,4 @@ github.com/graphprotocol/graph-node github.com/sushiswap/subgraphs github.com/cerc-io/go-nitro github.com/cerc-io/ts-nitro +github.com/cerc-io/mobymask-snap diff --git a/app/data/stacks/fixturenet-payments/stack.yml b/app/data/stacks/fixturenet-payments/stack.yml index 2984aafe..5fed8d13 100644 --- a/app/data/stacks/fixturenet-payments/stack.yml +++ b/app/data/stacks/fixturenet-payments/stack.yml @@ -14,6 +14,8 @@ repos: - github.com/cerc-io/watcher-ts@v0.2.61 - github.com/cerc-io/mobymask-v2-watcher-ts@v0.2.0 # TODO: Update - github.com/cerc-io/MobyMask@v0.1.3 + # mobymask app repos + - github.com/cerc-io/mobymask-snap containers: # fixturenet images - cerc/go-ethereum @@ -30,6 +32,8 @@ containers: - cerc/watcher-ts - cerc/watcher-mobymask-v3 - cerc/mobymask + # mobymask app images + - cerc/mobymask-snap pods: - fixturenet-eth - ipld-eth-server @@ -38,3 +42,4 @@ pods: - go-nitro - nitro-reverse-payment-proxy - watcher-mobymask-v3 + - mobymask-snap