Files
bridge/compose.testnet.yml
T
zeekay abb83626c9 manifests: align bridge-ui with Vite SPA (ghcr.io/hanzoai/spa, :80)
bridge-ui ships as a prebuilt Vite SPA inside ghcr.io/hanzoai/spa
(see app/bridge/Dockerfile final stage), not a Next.js dev container.
The compose + k8s manifests were still describing the old Next shape:
containerPort 3000, `npm run dev`, /app/.next volume mount, and
NEXT_PUBLIC_* env vars. None of that exists in the image anymore.

- compose.testnet.yml / compose.mainnet.yml: port 3001:80 (was 3001:3000);
  drop command + .next mount; swap NEXT_PUBLIC_* for VITE_BRIDGE_* env
  (the names app/bridge/src/bridge.config.ts reads).
- k8s/mpc-deployment.yaml: containerPort 80 (was 3000); Service
  targetPort 80 (was 3000 — broken since the static-SPA cutover); swap
  NEXT_PUBLIC_* for VITE_BRIDGE_* on the Deployment env.
- compose.yml: keep local hot-reload UX by mounting the repo root and
  running `pnpm -C app/bridge dev --host 0.0.0.0 --port 3001` against
  node:22-alpine. Dev port moves 3000 -> 3001 to match the published
  SPA convention across envs.
- scripts/start-local.sh: update printed UI URL to :3001.

compose.infra.yml and compose.local.yml don't define bridge-ui — left
untouched. scripts/launch-mpc-bridge.sh already prints :3001 and has no
Next-specific config; check-ci-status.sh only references bridge-ui as a
GHCR package name (image preserved per spec). Both verified clean.

Validated:
- docker compose -f compose.{yml,testnet,mainnet,infra,local}.yml config -q
- kubectl --dry-run=client apply -f k8s/mpc-deployment.yaml
2026-05-21 16:34:08 -07:00

295 lines
7.3 KiB
YAML

services:
# Infrastructure Services
nats:
image: nats:2.10-alpine
container_name: bridge-nats
restart: always
ports:
- "4222:4222"
- "8222:8222"
command: "-js -m 8222 --store_dir /data"
volumes:
- nats-data:/data
networks:
- bridge-network
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "4222"]
interval: 5s
timeout: 3s
retries: 5
consul:
image: hashicorp/consul:1.17
container_name: bridge-consul
restart: always
ports:
- "8500:8500"
- "8600:8600/udp"
command: "agent -server -bootstrap-expect=1 -ui -client=0.0.0.0 -datacenter=testnet"
volumes:
- consul-data:/consul/data
networks:
- bridge-network
environment:
- CONSUL_BIND_INTERFACE=eth0
- CONSUL_DATACENTER=testnet
healthcheck:
test: ["CMD", "consul", "members"]
interval: 5s
timeout: 3s
retries: 5
# Database
postgres:
image: ghcr.io/hanzoai/sql:latest
container_name: bridge-postgres
restart: always
environment:
- POSTGRES_USER=bridge
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-testnet123}
- POSTGRES_DB=bridge
volumes:
- postgres-data:/var/lib/postgresql/data
- ./scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
networks:
- bridge-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U bridge"]
interval: 5s
timeout: 3s
retries: 5
# MPC Nodes - Testnet configuration
mpc-node-0:
image: ghcr.io/luxfi/lux-mpc:latest
container_name: bridge-mpc-0
restart: always
environment:
- NODE_ID=mpc-node-0
- NODE_PORT=6000
- NATS_URL=nats://nats:4222
- CONSUL_URL=http://consul:8500
- DATA_DIR=/data/mpc
- LOG_LEVEL=debug
- MPC_THRESHOLD=2
- MPC_TOTAL_NODES=3
- MPC_KEY_PREFIX=bridge/mpc/testnet
- NETWORK=testnet
- ENABLE_TEST_MODE=true
volumes:
- mpc-data-0:/data/mpc
ports:
- "6000:6000"
- "9090:9090"
networks:
- bridge-network
depends_on:
nats:
condition: service_healthy
consul:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6000/health"]
interval: 10s
timeout: 5s
retries: 3
mpc-node-1:
image: ghcr.io/luxfi/lux-mpc:latest
container_name: bridge-mpc-1
restart: always
environment:
- NODE_ID=mpc-node-1
- NODE_PORT=6000
- NATS_URL=nats://nats:4222
- CONSUL_URL=http://consul:8500
- DATA_DIR=/data/mpc
- LOG_LEVEL=debug
- MPC_THRESHOLD=2
- MPC_TOTAL_NODES=3
- MPC_KEY_PREFIX=bridge/mpc/testnet
- NETWORK=testnet
- ENABLE_TEST_MODE=true
volumes:
- mpc-data-1:/data/mpc
ports:
- "6001:6000"
- "9091:9090"
networks:
- bridge-network
depends_on:
nats:
condition: service_healthy
consul:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6000/health"]
interval: 10s
timeout: 5s
retries: 3
mpc-node-2:
image: ghcr.io/luxfi/lux-mpc:latest
container_name: bridge-mpc-2
restart: always
environment:
- NODE_ID=mpc-node-2
- NODE_PORT=6000
- NATS_URL=nats://nats:4222
- CONSUL_URL=http://consul:8500
- DATA_DIR=/data/mpc
- LOG_LEVEL=debug
- MPC_THRESHOLD=2
- MPC_TOTAL_NODES=3
- MPC_KEY_PREFIX=bridge/mpc/testnet
- NETWORK=testnet
- ENABLE_TEST_MODE=true
volumes:
- mpc-data-2:/data/mpc
ports:
- "6002:6000"
- "9092:9090"
networks:
- bridge-network
depends_on:
nats:
condition: service_healthy
consul:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6000/health"]
interval: 10s
timeout: 5s
retries: 3
# Bridge Server - Testnet
bridge-server:
image: ghcr.io/luxfi/bridge-server:latest
container_name: bridge-server
restart: always
environment:
- NODE_ENV=staging
- PORT=3000
- DATABASE_URL=postgresql://bridge:${POSTGRES_PASSWORD:-testnet123}@postgres:5432/bridge
- NATS_URL=nats://nats:4222
- CONSUL_URL=http://consul:8500
- NODE_ID=bridge-server-0
- MPC_THRESHOLD=2
- MPC_TOTAL_NODES=3
- MPC_KEY_PREFIX=bridge/mpc/testnet
- NETWORK=testnet
- ENABLE_METRICS=true
- LOG_LEVEL=debug
- ENABLE_TEST_ENDPOINTS=true
- FAUCET_ENABLED=true
ports:
- "3000:3000"
- "9093:9090"
networks:
- bridge-network
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
consul:
condition: service_healthy
mpc-node-0:
condition: service_healthy
mpc-node-1:
condition: service_healthy
mpc-node-2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 3
# Bridge UI - Testnet — Vite SPA (ghcr.io/hanzoai/spa serves /dist on :80).
# VITE_BRIDGE_* env documents what the image was built with; the values
# become real only when baked at build time (app/bridge/Dockerfile).
bridge-ui:
image: ghcr.io/luxfi/bridge-ui:latest
container_name: bridge-ui
restart: always
environment:
- VITE_BRIDGE_API_HOST=https://bridge-api-testnet.lux.network
- VITE_BRIDGE_ENV=testnet
- VITE_BRIDGE_CLIENT_ID=lux-bridge
- VITE_BRIDGE_IAM_ORG=lux-network
ports:
- "3001:80"
networks:
- bridge-network
depends_on:
- bridge-server
# Monitoring - Lighter weight for testnet
prometheus:
image: prom/prometheus:latest
container_name: bridge-prometheus
restart: always
volumes:
- ./monitoring/prometheus/testnet.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
ports:
- "9094:9090"
networks:
- bridge-network
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=7d'
grafana:
image: grafana/grafana:latest
container_name: bridge-grafana
restart: always
ports:
- "3002:3000"
networks:
- bridge-network
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
# Test Explorer
explorer:
image: ghcr.io/luxfi/bridge-explorer:latest
container_name: bridge-explorer
restart: always
environment:
- API_URL=http://bridge-server:3000
- NETWORK=testnet
ports:
- "3003:3000"
networks:
- bridge-network
depends_on:
- bridge-server
volumes:
nats-data:
consul-data:
mpc-data-0:
mpc-data-1:
mpc-data-2:
postgres-data:
prometheus-data:
grafana-data:
networks:
bridge-network:
driver: bridge
ipam:
config:
- subnet: 172.21.0.0/16