1
0

Add container to mobymask-v2 stack for LXDAO mobymask-app (#347)

* Add container to stack for lxdao mobymask-app

* Remove shm_size

* Use cerc-io scoped alias for lxdao app package

* Change alias to @cerc-io/mobymask-ui-lxdao

Former-commit-id: 46b36c3cb6e9b4cbbaf908052d49e498f6397f33
This commit is contained in:
Nabarun Gogoi 2023-04-20 10:49:19 +05:30 committed by GitHub
parent b3feab0592
commit 35dd30f877
3 changed files with 45 additions and 6 deletions

View File

@ -13,6 +13,7 @@ services:
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
CERC_BUILD_DIR: "@cerc-io/mobymask-ui/build"
working_dir: /scripts
# Waits for watcher server to be up before app build
# Required when running with watcher stack to get deployed contract address
@ -28,12 +29,47 @@ services:
ports:
- "0.0.0.0:3002:80"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "80"]
test: ["CMD", "nc", "-vz", "localhost", "80"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
extra_hosts:
- "host.docker.internal:host-gateway"
# Builds and serves the LXDAO version of MobyMask react-app
lxdao-mobymask-app:
restart: unless-stopped
image: cerc/mobymask-ui:local
env_file:
- ../config/watcher-mobymask-v2/mobymask-params.env
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_CHAIN_ID: ${CERC_CHAIN_ID}
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
CERC_BUILD_DIR: "@cerc-io/mobymask-ui-lxdao/build"
working_dir: /scripts
# Waits for watcher server to be up before app build
# Required when running with watcher stack to get deployed contract address
command:
- sh
- -c
- ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./mobymask-app-start.sh
volumes:
- ../config/wait-for-it.sh:/scripts/wait-for-it.sh
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
- peers_ids:/peers
- mobymask_deployment:/server
ports:
- "0.0.0.0:3004:80"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "80"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
shm_size: '1GB'
extra_hosts:
- "host.docker.internal:host-gateway"

View File

@ -31,7 +31,7 @@ RUN \
# Install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends jq bash
&& apt-get -y install --no-install-recommends jq bash netcat
# We do this to get a yq binary from the published container, for the correct architecture we're building here
COPY --from=docker.io/mikefarah/yq:latest /usr/bin/yq /usr/local/bin/yq
@ -48,8 +48,11 @@ RUN mkdir -p /config
# Install simple web server for now (use nginx perhaps later)
RUN yarn global add http-server
# Globally install the payload web app package
RUN yarn global add @cerc-io/mobymask-ui
# Globally install both versions of the payload web app package
# Install old version of MobyMask web app
RUN yarn global add @cerc-io/mobymask-ui@0.1.2
# Install the LXDAO version of MobyMask web app
RUN yarn global add @cerc-io/mobymask-ui-lxdao@npm:@cerc-io/mobymask-ui@0.1.2-lxdao-0.1.0
# Expose port for http
EXPOSE 80

View File

@ -4,6 +4,6 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
fi
# TODO: Don't hard wire this:
webapp_files_dir=/usr/local/share/.config/yarn/global/node_modules/@cerc-io/mobymask-ui/build
webapp_files_dir="/usr/local/share/.config/yarn/global/node_modules/${CERC_BUILD_DIR}"
/scripts/apply-webapp-config.sh /config/config.yml ${webapp_files_dir} MOBYMASK_HOSTED_CONFIG
http-server -p 80 ${webapp_files_dir}