Skip to content

Instantly share code, notes, and snippets.

@Willburn
Last active April 26, 2020 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Willburn/5c40e6b05010623ad8c596bcedc0c19b to your computer and use it in GitHub Desktop.
Save Willburn/5c40e6b05010623ad8c596bcedc0c19b to your computer and use it in GitHub Desktop.
version: '3.7'
services:
# COMMENT FOR YOUR DOCKER SWARM
# for this to work:
# constraints you need to register a label for each computer in the swarm.
# you need to have initialized a swarm https://docs.docker.com/engine/reference/commandline/swarm_init/ and made workers join it
# then you need to label the manager and the workers with docker node update --label-add comp=yourcomputertodeploy id_of_your_node
# you need to set CNODEIP with your public ip.
# you need to set published port to ports you have open on the local computer your deploying too and router/internet of that computer
# you need to have a local volume with the 3 config files nodeconfig.yaml, genesis.json and topology.json
xxnameofyourfirstnode:
image: eysteinh/cnode:1.11.0
deploy:
placement:
constraints:
- node.labels.comp==yourcomputertodeploy
replicas: 1
restart_policy:
condition: any
volumes:
- yourlocalconfigfolder for node 1:/srv/cardano/cardano-node/config
tty: true
stdin_open: true
environment:
- CNODEIPV4=xx.xx.xx.xx
ports:
- target: 3000
published: xxxx
protocol: tcp
mode: host
xxnameofsecondnode:
image: eysteinh/cnode:1.11.0
deploy:
placement:
constraints:
- node.labels.comp==yourcomputertodeploy
replicas: 1
restart_policy:
condition: any
volumes:
- yourlocalconfigfolder for node 2:/srv/cardano/cardano-node/config
tty: true
stdin_open: true
environment:
- CNODEIPV4=xx.xx.xx.xx
ports:
- target: 3000
published: xxxx
protocol: tcp
mode: host
xxnameofyourthirdnode:
image: eysteinh/cnode:1.11.0
deploy:
placement:
constraints:
- node.labels.comp==yourcomputertodeploy
replicas: 1
restart_policy:
condition: any
volumes:
- your local config folder for node 3:/srv/cardano/cardano-node/config
tty: true
stdin_open: true
environment:
- CNODEIPV4=xx.xx.xx.xx
ports:
- target: 3000
published: xxxx
protocol: tcp
mode: host
xxnameofyourfourthnode:
image: eysteinh/cnode:1.11.0
deploy:
placement:
constraints:
- node.labels.comp==yourcomputertodeploy
replicas: 1
restart_policy:
condition: any
volumes:
- your local config folder for node 4:/srv/cardano/cardano-node/config
tty: true
stdin_open: true
environment:
- CNODEIPV4=xx.xx.xx.xx
ports:
- target: 3000
published: xxxx
protocol: tcp
mode: host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment