Production-ready docker-compose for Connext routers.
- Docker CE (Community Edition) version 20.10.5 or higher
- Docker Compose version 1.27.4 or higher
- Clone repo
cd ~
git clone https://github.com/connext/router-docker-compose.git
cd ~/router-docker-compose
- Rename file
.env.example
to.env
and modify it. You need to set the following environment variables:
ROUTER_VERSION
- version to use, get router version from either https://github.com/connext/nxtp/pkgs/container/router-publisher or#amarok-routers
channel in DiscordGRAFANA_PASSWORD
- your password for GrafanaLOGDNA_KEY
- LogDNA key, you need to register in Mezmo App and get it from there. You can optionally setLOGDNA_TAG
as wellUSERID
- if you use docker rootless, then it should be ID of your user e.g. 1001.*_VERSION
- you can optionally set docker container versions of other apps
-
Modify
data/alertmanagerConfig/alertmanager.yml
file and set alert notifications to Mail, Slack, Discord, Telegram, Pagerduty, Opsgenie, etc. Additional configuration might be required. -
Create NXTP configuration file
~/router-docker-compose/config.json
, it will be mounted into router container. See Connext Configuration docs for configuration description. You can useconfig.example.mainnet.json
orconfig.example.testnet.json
as an example. -
(Optional) Create external Redis instance and insert URL into
redisUrl
in config. (currently the docker-compose file includes redis container as well). If you want to use highly available RabbitMQ service - you can spin up it as well and updateconfig.json
as well. -
(Optional) Follow security best practices from Connext Security docs
-
(Optional) Use docker rootless configuration for better security. Just use
docker-compose-rootless.yml
instead ofdocker-compose.yml
and follow Docker Rootless Guide to enable it. -
(Optional) Edit
docker-compose.yml
to enable port forwarding for Router services and/or Prometheus/Alertmanager. It's disabled by default for security reasons. Do NOT expose these port to public networks, otherwise use proven authentication methods. -
Rename file
key.example.yaml
tokey.yaml
and modify it. Web3Signer yaml key file~/router-docker-compose/key.yaml
will be mounted into the signer container. This example file uses raw unencrypted files method. See Web3Signer docs. And for more custom commands of web3signer, edit~/router-docker-compose/data/signerConfig/config.yaml
. Refer Web3Signer Command docs -
Create docker-compose services, volumes and network.
docker-compose create
- Run docker-compose stack.
docker-compose up -d
- Check the status.
docker-compose ps
OR
docker ps -a
- Check logs to ensure router started successfully
docker-compose logs router-publisher | tail -n 200| grep 'Router publisher boot complete!'
docker-compose logs router-subscriber | tail -n 200| grep 'Router subscriber boot complete!'
- Check the full logs if needed
docker-compose logs
OR
docker-compose logs router-publisher
docker-compose logs router-subscriber
You can also use these commands.
docker logs router-publisher
docker logs router-subscriber
docker-compose down
docker-compose down -v
docker-compose restart
- Modify
.env
to changeROUTER_VERSION
- Update stack
docker-compose pull
docker-compose up -d