forked from cerc-io/stack-orchestrator
Nabarun Gogoi
c4002dcc5c
* Use standalone mobymask-v2-watcher-ts to run peer test * Add watcher-ts image for running peer tests * Run separate containers for peer ids generation and tests * Wait for watcher to be up before starting peer-test-app * Resolve peer-test-app compose file and remove setup-repositories for web-apps
139 lines
4.9 KiB
YAML
139 lines
4.9 KiB
YAML
version: '3.2'
|
|
|
|
services:
|
|
# Starts the PostgreSQL database for watcher
|
|
mobymask-watcher-db:
|
|
restart: unless-stopped
|
|
image: postgres:14-alpine
|
|
environment:
|
|
- POSTGRES_USER=vdbm
|
|
- POSTGRES_MULTIPLE_DATABASES=mobymask-watcher,mobymask-watcher-job-queue
|
|
- POSTGRES_EXTENSION=mobymask-watcher-job-queue:pgcrypto
|
|
- POSTGRES_PASSWORD=password
|
|
volumes:
|
|
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
|
|
- mobymask_watcher_db_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "0.0.0.0:15432:5432"
|
|
healthcheck:
|
|
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
|
interval: 20s
|
|
timeout: 5s
|
|
retries: 15
|
|
start_period: 10s
|
|
|
|
# Deploys the MobyMask contract and generates an invite link
|
|
# Deployment is skipped if CERC_DEPLOYED_CONTRACT env is set
|
|
mobymask:
|
|
image: cerc/mobymask:local
|
|
working_dir: /app/packages/server
|
|
env_file:
|
|
- ../config/watcher-mobymask-v2/optimism-params.env
|
|
- ../config/watcher-mobymask-v2/mobymask-params.env
|
|
environment:
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
ENV: "PROD"
|
|
CERC_L2_GETH_RPC: ${CERC_L2_GETH_RPC}
|
|
CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER}
|
|
CERC_MOBYMASK_APP_BASE_URI: ${CERC_MOBYMASK_APP_BASE_URI}
|
|
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
|
# Waits for L2 Optimism Geth and Node servers to be up before deploying contract
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
./wait-for-it.sh -h ${CERC_L2_GETH_HOST:-$${DEFAULT_CERC_L2_GETH_HOST}} -p ${CERC_L2_GETH_PORT:-$${DEFAULT_CERC_L2_GETH_PORT}} -s -t 0 && \
|
|
./wait-for-it.sh -h ${CERC_L2_NODE_HOST:-$${DEFAULT_CERC_L2_NODE_HOST}} -p ${CERC_L2_NODE_PORT:-$${DEFAULT_CERC_L2_NODE_PORT}} -s -t 0 && \
|
|
./deploy-and-generate-invite.sh
|
|
volumes:
|
|
- ../config/wait-for-it.sh:/app/packages/server/wait-for-it.sh
|
|
- ../config/watcher-mobymask-v2/secrets-template.json:/app/packages/server/secrets-template.json
|
|
- ../config/watcher-mobymask-v2/deploy-and-generate-invite.sh:/app/packages/server/deploy-and-generate-invite.sh
|
|
- mobymask_deployment:/app/packages/server
|
|
- fixturenet_geth_accounts:/geth-accounts:ro
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
# Creates peer-id files if they don't exist
|
|
peer-ids-gen:
|
|
image: cerc/watcher-ts:local
|
|
restart: on-failure
|
|
environment:
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
working_dir: /app/packages/peer
|
|
command: ["sh", "generate-peer-ids.sh"]
|
|
volumes:
|
|
- ../config/watcher-mobymask-v2/generate-peer-ids.sh:/app/packages/peer/generate-peer-ids.sh
|
|
- peers_ids:/peer-ids
|
|
|
|
# Starts the mobymask-v2-watcher server
|
|
mobymask-watcher-server:
|
|
image: cerc/watcher-mobymask-v2:local
|
|
restart: unless-stopped
|
|
depends_on:
|
|
mobymask-watcher-db:
|
|
condition: service_healthy
|
|
peer-ids-gen:
|
|
condition: service_completed_successfully
|
|
mobymask:
|
|
condition: service_completed_successfully
|
|
env_file:
|
|
- ../config/watcher-mobymask-v2/optimism-params.env
|
|
- ../config/watcher-mobymask-v2/mobymask-params.env
|
|
environment:
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
CERC_L2_GETH_RPC: ${CERC_L2_GETH_RPC}
|
|
CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER}
|
|
CERC_RELAY_PEERS: ${CERC_RELAY_PEERS}
|
|
CERC_RELAY_ANNOUNCE_DOMAIN: ${CERC_RELAY_ANNOUNCE_DOMAIN}
|
|
CERC_ENABLE_PEER_L2_TXS: ${CERC_ENABLE_PEER_L2_TXS}
|
|
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
|
command: ["sh", "start-server.sh"]
|
|
volumes:
|
|
- ../config/watcher-mobymask-v2/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
|
- ../config/watcher-mobymask-v2/start-server.sh:/app/start-server.sh
|
|
- peers_ids:/app/peers
|
|
- mobymask_deployment:/server
|
|
- fixturenet_geth_accounts:/geth-accounts:ro
|
|
# Expose GQL, metrics and relay node ports
|
|
ports:
|
|
- "0.0.0.0:3001:3001"
|
|
- "0.0.0.0:9001:9001"
|
|
- "0.0.0.0:9090:9090"
|
|
healthcheck:
|
|
test: ["CMD", "busybox", "nc", "localhost", "9090"]
|
|
interval: 20s
|
|
timeout: 5s
|
|
retries: 15
|
|
start_period: 5s
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
# Container to run peer tests
|
|
peer-tests:
|
|
image: cerc/watcher-ts:local
|
|
restart: on-failure
|
|
depends_on:
|
|
mobymask-watcher-server:
|
|
condition: service_healthy
|
|
peer-ids-gen:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
working_dir: /app/packages/peer
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
./set-tests-env.sh && \
|
|
tail -f /dev/null
|
|
volumes:
|
|
- ../config/watcher-mobymask-v2/set-tests-env.sh:/app/packages/peer/set-tests-env.sh
|
|
- peers_ids:/peer-ids
|
|
|
|
volumes:
|
|
mobymask_watcher_db_data:
|
|
peers_ids:
|
|
mobymask_deployment:
|
|
fixturenet_geth_accounts:
|