Script for deploying containers to docker enabled DigitalOcean droplets
-d— Set the dir to upload from (defaults to.)-n— Set the droplet name (defaults to the upload dir name)-e— Set environment variables passed to docker-compose (e.g.-e FOO=bar -e BAZ=qux)
up— Creates a Docker enabled DigitalOcean dropletdns— Creates an A record pointing to the droplets public ipv4 addressprovision— Rsyncs local source code to droplet and runs docker-composersync— Rsyncs local source code to dropletrestart— Restarts the containers on on the dropletstatus— Shows the status of the droplet and ipv4 addressdown— Destroys the droplet/docker-compose servicesssh— Connects to the droplet via SSHlogs— Tails logs of containers on the droplet
The below command will create a new droplet (with docker and docker-compose installed), rsync the contets of ./example to the droplet, and run docker-compose up.
./dropler.sh up -d ./exampleIf you make a change to your source, running the below command will rsync the source to the droplet and re-build/re-run the container:
./dropler.sh provision -d ./exampleYou can get logs from the docker-compose process like so:
./dropler.sh logs -d ./exampleSSH into the droplet:
./dropler.sh ssh -d ./example... finally, to destroy the droplet:
./dropler.sh down -d ./example