2023-03-20 12:55:39 +00:00
|
|
|
version: '3.2'
|
|
|
|
|
|
|
|
services:
|
2023-04-06 09:47:00 +00:00
|
|
|
# Starts the PostgreSQL database for watcher
|
2023-03-20 12:55:39 +00:00
|
|
|
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
|
|
|
|
|
2023-04-11 10:51:03 +00:00
|
|
|
# Deploys the MobyMask contract and generates an invite link
|
|
|
|
# Deployment is skipped if CERC_DEPLOYED_CONTRACT env is set
|
2023-03-24 11:53:54 +00:00
|
|
|
mobymask:
|
|
|
|
image: cerc/mobymask:local
|
|
|
|
working_dir: /app/packages/server
|
2023-04-05 11:56:38 +00:00
|
|
|
env_file:
|
|
|
|
- ../config/watcher-mobymask-v2/optimism-params.env
|
2023-04-06 09:47:00 +00:00
|
|
|
- ../config/watcher-mobymask-v2/mobymask-params.env
|
2023-03-24 11:53:54 +00:00
|
|
|
environment:
|
2023-04-11 10:51:03 +00:00
|
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
|
|
ENV: "PROD"
|
|
|
|
CERC_L2_GETH_RPC: ${CERC_L2_GETH_RPC}
|
2023-04-20 09:42:59 +00:00
|
|
|
CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL}
|
2023-04-11 10:51:03 +00:00
|
|
|
CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER}
|
|
|
|
CERC_MOBYMASK_APP_BASE_URI: ${CERC_MOBYMASK_APP_BASE_URI}
|
|
|
|
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
2023-04-20 10:00:19 +00:00
|
|
|
CERC_L2_GETH_HOST: ${CERC_L2_GETH_HOST}
|
|
|
|
CERC_L2_GETH_PORT: ${CERC_L2_GETH_PORT}
|
|
|
|
CERC_L2_NODE_HOST: ${CERC_L2_NODE_HOST}
|
|
|
|
CERC_L2_NODE_PORT: ${CERC_L2_NODE_PORT}
|
|
|
|
command: ["sh", "deploy-and-generate-invite.sh"]
|
2023-03-24 11:53:54 +00:00
|
|
|
volumes:
|
2023-04-05 11:56:38 +00:00
|
|
|
- ../config/wait-for-it.sh:/app/packages/server/wait-for-it.sh
|
2023-04-03 12:43:29 +00:00
|
|
|
- ../config/watcher-mobymask-v2/secrets-template.json:/app/packages/server/secrets-template.json
|
2023-04-04 09:23:28 +00:00
|
|
|
- ../config/watcher-mobymask-v2/deploy-and-generate-invite.sh:/app/packages/server/deploy-and-generate-invite.sh
|
2023-04-05 12:22:12 +00:00
|
|
|
- mobymask_deployment:/app/packages/server
|
2023-04-05 11:56:38 +00:00
|
|
|
extra_hosts:
|
|
|
|
- "host.docker.internal:host-gateway"
|
2023-03-24 11:53:54 +00:00
|
|
|
|
2023-04-19 08:18:51 +00:00
|
|
|
# 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
|
|
|
|
|
2023-04-06 09:47:00 +00:00
|
|
|
# Starts the mobymask-v2-watcher server
|
2023-03-20 12:55:39 +00:00
|
|
|
mobymask-watcher-server:
|
2023-04-11 10:51:03 +00:00
|
|
|
image: cerc/watcher-mobymask-v2:local
|
2023-03-20 12:55:39 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
|
|
mobymask-watcher-db:
|
|
|
|
condition: service_healthy
|
2023-04-19 08:18:51 +00:00
|
|
|
peer-ids-gen:
|
|
|
|
condition: service_completed_successfully
|
2023-03-30 04:14:15 +00:00
|
|
|
mobymask:
|
2023-04-05 11:56:38 +00:00
|
|
|
condition: service_completed_successfully
|
|
|
|
env_file:
|
|
|
|
- ../config/watcher-mobymask-v2/optimism-params.env
|
2023-04-06 09:47:00 +00:00
|
|
|
- ../config/watcher-mobymask-v2/mobymask-params.env
|
2023-04-11 10:51:03 +00:00
|
|
|
environment:
|
|
|
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
|
|
CERC_L2_GETH_RPC: ${CERC_L2_GETH_RPC}
|
2023-04-20 09:42:59 +00:00
|
|
|
CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL}
|
2023-04-11 10:51:03 +00:00
|
|
|
CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER}
|
2023-04-12 12:47:13 +00:00
|
|
|
CERC_RELAY_PEERS: ${CERC_RELAY_PEERS}
|
2023-05-04 14:30:58 +00:00
|
|
|
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
2023-04-12 12:47:13 +00:00
|
|
|
CERC_RELAY_ANNOUNCE_DOMAIN: ${CERC_RELAY_ANNOUNCE_DOMAIN}
|
2023-04-11 10:51:03 +00:00
|
|
|
CERC_ENABLE_PEER_L2_TXS: ${CERC_ENABLE_PEER_L2_TXS}
|
|
|
|
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
2023-04-05 12:22:12 +00:00
|
|
|
command: ["sh", "start-server.sh"]
|
2023-03-20 12:55:39 +00:00
|
|
|
volumes:
|
2023-04-19 08:18:51 +00:00
|
|
|
- ../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
|
2023-04-05 12:22:12 +00:00
|
|
|
- mobymask_deployment:/server
|
2023-04-06 09:47:00 +00:00
|
|
|
# Expose GQL, metrics and relay node ports
|
2023-03-20 12:55:39 +00:00
|
|
|
ports:
|
|
|
|
- "0.0.0.0:3001:3001"
|
|
|
|
- "0.0.0.0:9001:9001"
|
|
|
|
- "0.0.0.0:9090:9090"
|
|
|
|
healthcheck:
|
2023-03-24 11:53:54 +00:00
|
|
|
test: ["CMD", "busybox", "nc", "localhost", "9090"]
|
2023-03-20 12:55:39 +00:00
|
|
|
interval: 20s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 15
|
|
|
|
start_period: 5s
|
2023-04-05 11:56:38 +00:00
|
|
|
extra_hosts:
|
|
|
|
- "host.docker.internal:host-gateway"
|
2023-03-20 12:55:39 +00:00
|
|
|
|
2023-04-19 08:18:51 +00:00
|
|
|
# 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
|
|
|
|
|
2023-03-20 12:55:39 +00:00
|
|
|
volumes:
|
|
|
|
mobymask_watcher_db_data:
|
2023-04-12 12:47:13 +00:00
|
|
|
peers_ids:
|
2023-04-05 12:22:12 +00:00
|
|
|
mobymask_deployment:
|