Read my blog post about this repo.
eval $(docker-machine env default)
docker-compose up
Visit http://192.168.99.100/
to see what's happening locally.
docker-compose down
Now you've taken down the stack.
docker-machine create --driver digitalocean \
--digitalocean-image ubuntu-16-04-x64 \
--digitalocean-private-networking \
--digitalocean-access-token $DOTOKEN node-1 &
docker-machine create --driver digitalocean \
--digitalocean-image ubuntu-16-04-x64 \
--digitalocean-private-networking \
--digitalocean-access-token $DOTOKEN node-2 &
docker-machine create --driver digitalocean \
--digitalocean-image ubuntu-16-04-x64 \
--digitalocean-private-networking \
--digitalocean-access-token $DOTOKEN node-3 &
After running the commands below you will get a command to run on the worker nodes.
docker-machine ls # to get the IP address of the nodes
docker swarm init --advertise-addr IP.A.DDRE.SS
Running commands on worker nodes is easy! Replace the node name below and the command. Boom.
docker-machine ssh node-2 "ls"
eval $(docker-machine env node-1)
./build
./deploy
toc
If you get the following error message follow the solution below.
this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again
solution: run eval $(docker-machine env node-1)
and try again.
The following error may have more than one solution.
ERROR: for phpdocker_web_1 Cannot start service web: OCI runtime create failed: container_linux.go:295: starting container process caused "process_linux.go:399: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/levidurfee/Projects/levilol/php-docker/docker/nginx/nginx.key\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/6d22d8efdec1944f3e76ce79ed2ce60aa81aa358e080f22929619d90c21a4825\\\" at \\\"/var/lib/docker/aufs/mnt/6d22d8efdec1944f3e76ce79ed2ce60aa81aa358e080f22929619d90c21a4825/etc/nginx/nginx.key\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
solution: run eval $(docker-machine env default)
and try again.
Instead of paying for the Droplets to host this sample app I decided to record my terminal while I curl'd the app.