Start and manage multiple containers with Triton Compose
Docker Compose is a tool for defining and running applications with multiple containers. A
docker-compose.yml file configures the application services. Triton Compose is the version of Docker Compose which you can use to scale or start applications on Triton.
Instead of using
triton-docker run three, four, or five times in order to start containers or scale your application, a Compose file does the hard work for you. On Triton, your containers will run on different physical servers across the cloud.
Docker Compose makes it easy to deploy rolling changes to your application and give your users a seemless experience. As long as you have more than one instance running, you can update your application with no downtime.
Watch the video to learn more.
We built an Autopilot Pattern WordPress application which uses Compose to spin up several different containers including WordPress, Nginx, MySQL, and more. The application is infinitely easier scale with Compose. Instead of having to use
triton-docker run with every different container to spin up a new instance, you can run
triton-compose scale with the name of the instance and the number of instances you want to exist.
If we decided to scale WordPress, Nginx, and MySQL, the command would look like this:
$ triton-compose scale wordpress=3 nginx=3 mysql=3
Scaling back down is the same command, just with fewer instances—for the above example, that could look like
triton-compose scale wordpress=2 nginx=2 mysql=2.
Here are some other examples of projects using Docker Compose:
- Databases, such as MySQL and MongoDB
- Nginx, with automatic SSL via Let's Encrypt
- Learning apps, like hello world and a Node.js example
While we technically support any version of the Docker Compose syntax, we don't support all the options of every version.