PageSourceSearch

https://tritoncloud.io/assets/using-docker-compose-DolxCqcj.js

js tritoncloud.io collected 2026-10-09 04:56:09 UTC 4,746 bytes, 62 lines download raw bytes

1const e=`---
2title: "Easily scale application with Docker Compose on Triton"
3summary: "Since publishing this blog post and video, we have released Triton Docker CLI to ensure use of known good versions of Docker on Triton. Instead of using docker-compose ... for spinning up and scaling a"
4author: "Alexandra White"
5date: 2017-05-11
6tags: [docker, networking]
7source: "https://www.tritondatacenter.com/blog/using-docker-compose"
8---
9
10### Updated Docker syntax
11
12Since publishing this blog post and video, we have released [Triton Docker CLI](https://github.com/joyent/triton-docker-cli) to ensure use of known good versions of Docker on Triton. Instead of using \`docker-compose ...\` for spinning up and scaling applications, you can use \`triton-compose ...\`.
13
14Docker Compose is the easiest way to get started with dockerized, multi-container applications on Triton's Elastic Docker Host. The Triton Elastic Docker Host automatically runs your containers across the data center for the best performance and scale. Docker Compose makes it possible to start multi-container applications with a single command, \`docker-compose up -d\`, and quickly scale those applications with \`docker-compose scale...\`. It’s as if you can supercharge your application and become nimbler to the needs of your users.
15
16With Docker Compose on Triton, you can manage the whole lifecycle of your application. 
17
18## Watch the video
19
20*
21Watch the overview of how Docker Compose can make managing single or multi-service applications simple.
22
23## Video transcript
24
25The best way to deploy an application powered by Docker on Triton is with Docker Compose.
26
27Docker Compose makes it simple to run and update multi-container applications. All it takes is a simple configuration file, and with a short command you can get your application up and running, scale your application, and much more.
28
29Let’s try it out with dockerized web application. This application only has one service, so the Docker Compose File will be very straight forward.
30
31In your terminal, navigate to the directory of your application. Using the \`touch\` command to create an empty file, create the \`docker-compose.yml\` configuration.
32
33Every service must first be declared. We’ll call this service \`nginx\`, as Nginx is the base image for this service. 
34
35Next, we’ll declare the service’s image. This will be the image you’ve already created for your application. It can also be one of the various official base images.
36
37Then we’ll declare the ports. Because this is a web application, we know that we need to declare port 80. 
38
39We’ll declare a memory limit. We know this is a small application, so the container doesn’t need to have a limit any higher than 128 megabytes.
40
41Finally, we’ll add a Triton CNS service label so that we can easily add a DNS name to our application. You can learn more about that in [our video series on Triton CNS](https://docs.tritondatacenter.com/public-cloud/network/cns#introduction-to-triton-cns).
42
43There are numerous other declarations that could be made, but for now, we’re ready to spin up our application.
44
45Spinning up a container with Docker Compose is super simple. All it takes is this one command, \`docker 
45compose up\`, and it will spin up a detached container named by the directory, service, and instance number.
46
47Let’s get the DNS name of application, so we can open it in our browser. To do so, we’ll need to get some more information about the instance from Triton. The last result in our query will be our CNS-powered DNS name, which will remain unchanged no matter how big or small you scale the application.
48
49That’s all it takes to spin up an app with Docker Compose! But say you want more containers up to handle larger volumes of traffic. You can scale it up just as easily. This will scale your application across the data center.
50
51Let’s check out our application with \`dig\` to see how our DNS name is affected.
52
53As you can see, there are now 3 IP addresses pointing to our DNS name, for the three existing containers.
54
55In the browser, I can go back to the application and know it’s round-robinning through the existing containers in order to distribute the traffic.
56
57A more complicated application may name 2, 3, 4, or more services in the Compose file. Check out the Docker Compose file for our WordPress application on the AutoPilot Pattern. 
58
59Spinning up WordPress is exactly the same process as deploying  a single-service application. To scale, name the individual services and give a number of instances to create. You don't need to declare the same number of instances for each service.
60
61Now go forth and spin up your applications quickly and easily with Docker Compose on Triton.
62`;export{e as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.