
# These are development notes NOT instructions!


# on host 


docker-machine ls

docker-machine create --driver virtualbox manager1
docker-machine create --driver virtualbox worker1
docker-machine create --driver virtualbox worker2

docker-machine ls

# MANAGER-IP
docker-machine ip manager1

docker-machine ssh manager1

# inside manager1

docker swarm init --advertise-addr <MANAGER-IP>

docker swarm join-token worker

exit



docker-machine ssh worker1

# inside worker1

docker swarm join --token <TOKEN> <MANAGER-IP>:2377

exit



docker-machine ssh worker2

# inside worker2

docker swarm join --token <TOKEN> <MANAGER-IP>:2377

exit



docker-machine ssh manager1 -A

# inside manager1

docker node ls

docker network create --driver overlay ramanujan

docker network ls


# install emacs
tce
# emacs.tcz
# libXrandr.tcz
# make.tcz

TERM=vt100 emacs -nw  


# IMPORTANT: use the same host name everywhere otherwise swim-js mappings will fail


# TODO: order properly

docker service create --replicas 1 --network ramanujan --name base1 -e TAG=base1 -e PORT=39000 -e HOST=base
1 -e BASES=base0:39000,base1:39000 base


docker service create --replicas 1 --network ramanujan -p 10001:10001 --name repl -e TAG=repl -e REPL_HOST=0.0.0.0  -e HOST=@eth2 -e BASES=base0:3900
0,base1:39000 repl


# eth2 as publish
docker service create --replicas 1 --network ramanujan --publish 8000:8000 --name front -e HOST=eth2
 -e BASES=base0:39000,base1:39000 front


# eth0 as no publish
docker service create --replicas 1 --network ramanujan  --name home -e HOST=eth0 -e BASES=base0:39000,ba
se1:39000 home



# stack

docker stack deploy -c ramanujan.yml ramanujan
docker stack rm ramanujan


# monitor

docker exec -it `docker ps | grep repl | cut -f 1 -d ' '` /bin/sh
$ node monitor.js

