Skip to content

Commit 35568d5

Browse files
Merge pull request #1191 from londoncalling/voting-app-example-draft2
draft 3 voting app sample updates
2 parents c948e6f + f3945de commit 35568d5

File tree

5 files changed

+71
-62
lines changed

5 files changed

+71
-62
lines changed

compose/compose-file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ This will result in an image named `webapp` and tagged `tag`, built from `./dir`
7070
7171
> **Note:** This option is ignored when
7272
> [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md)
73-
> with a (version 3) Compose file.
73+
> with a (version 3) Compose file. The `docker stack` command accepts only pre-built images.
7474
7575
#### context
7676

engine/getstarted-voting-app/create-swarm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords: multi-container, services, swarm mode, cluster, voting app
44
title: Create a swarm
55
---
66

7-
Now, we'll add our Docker machines to a swarm.
7+
Now, we'll add our Docker machines to a [swarm](/engine/swarm/index.md).
88

99
## Initialize the swarm
1010

engine/getstarted-voting-app/customize-app.md

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Customize the voting app
33
keywords: multi-container, services, swarm mode, cluster, voting app, docker-stack.yml, docker stack deploy
4-
title: Customize the app and redeploy
4+
title: Tour the voting app sample
55
---
66

77

@@ -23,6 +23,7 @@ Go back to `docker-stack.yml` and replace the `before` tags on both the `vote` a
2323

2424
![after tags for vote and result in yml](images/customize-after.png)
2525

26+
2627
## Redeploy
2728

2829
Run the same deploy command again to run the app with the new configuration.
@@ -68,20 +69,26 @@ did not change.
6869

6970
## Resources
7071

71-
The source code for the voting app and a deeper dive example walkthrough will be made available at [Docker Labs](https://github.com/docker/labs).
72-
73-
The lab walkthrough provides more technical detail on deployment configuration, Compose file keys, the application and stack and services concepts, and networking.
74-
75-
The images you used are available on Docker Hub. When you ran `docker-stack.yml` you pulled those images from Docker Hub.
76-
77-
For information on how to build your own images, see:
72+
* A deeper dive voting app walkthrough is available on
73+
[Docker Labs](https://github.com/docker/labs/) as [Deploying an app to a Swarm]
74+
(https://github.com/docker/labs/blob/master/beginner/chapters/votingapp.md).
75+
The lab walkthrough provides more technical detail on deployment configuration,
76+
Compose file keys, the application, stack and services concepts, and
77+
networking.
7878

79-
* [Build your own image](/engine/getstarted/step_four.md) in the [Get Started with Docker tutorial](/engine/getstarted/index.md)
79+
* [Source code for the Voting App](https://github.com/docker/example-voting-app) (to go along with the lab walkthrough) is also available on Docker Labs.
8080

81-
* [Build your own images](/engine/tutorials/dockerimages.md) in the [Learn by example](/engine/tutorials/index.md) tutorials
81+
* The images you used are available on [Docker Hub](https://hub.docker.com/). When you ran `docker-stack.yml` you pulled those images from Docker Hub.
8282

83-
* [Docker Labs](https://github.com/docker/labs)
83+
* To learn how to build your own images, see
84+
[Build your own image](/engine/getstarted/step_four.md) in Get Started with
85+
Docker and topics on images in [Learn by example](/engine/tutorials/index.md).
8486

85-
For more about `docker-stack.yml` and the `docker stack deploy` command, see [deploy](/compose/compose-file.md#deploy) in the [Compose file reference](/compose/compose-file.md).
87+
* For more about `docker-stack.yml` and the `docker stack deploy` command,
88+
see [deploy](/compose/compose-file.md#deploy) in the [Compose file
89+
reference](/compose/compose-file.md) and [`docker stack
90+
deploy`](/engine/reference/commandline/stack_deploy.md) in the Docker Engine
91+
command line reference.
8692

87-
To learn more about swarm mode, start with the [Swarm mode overview](/engine/swarm/overview.md).
93+
* To learn more about swarm mode, start with the
94+
[Swarm mode overview](/engine/swarm/index.md).

engine/getstarted-voting-app/index.md

+48-46
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
description: overview of voting app example
3-
keywords: docker-stack.yml, stack deploy, compose, container, multi-container, services, swarm mode, cluster, voting app,
4-
title: Tour the voting app sample
3+
keywords: docker-stack.yml, stack deploy, compose, multi-container, services, swarm mode, cluster, voting app,
4+
title: Define and deploy your app
55
---
66

77
This example is built around a web-based voting application that collects,
88
tallies, and returns the results of votes (for cats and dogs, or other choices
99
you specify). The voting app includes several services, each one running in its
1010
own container. We'll deploy the app as a _stack_ to introduce some new concepts
11-
surfaced in [Compose v.3](/compose/compose-file.md), and also use [swarm
11+
surfaced in [Compose Version 3](/compose/compose-file.md), and also use [swarm
1212
mode](/engine/swarm/index.md), which is cluster management and orchestration
1313
capability built into Docker Engine.
1414

@@ -19,11 +19,12 @@ Docker](/engine/getstarted/step_one.md#step-1-get-docker) and grab Docker for
1919
your platform. You can follow along and run this example using Docker for Mac,
2020
Docker for Windows or Docker for Linux.
2121

22-
Once you have Docker installed, you can run `docker hello-world`
23-
or other commands described in the Get Started with Docker tutorial to
24-
[verify your installation](/engine/getstarted/step_one.md#step-3-verify-your-installation).
25-
If you are totally new to Docker, you might continue through the full [Get Started with Docker
26-
tutorial](/engine/getstarted/index.md) first, then come back.
22+
Once you have Docker installed, you can run `docker hello-world` or other
23+
commands described in the Get Started with Docker tutorial to [verify your
24+
installation](/engine/getstarted/step_one.md#step-3-verify-your-installation).
25+
If you are totally new to Docker, you might continue through the full [Get
26+
Started with Docker tutorial](/engine/getstarted/index.md) first, then come
27+
back.
2728

2829
## What you'll learn and do
2930

@@ -38,7 +39,7 @@ the `docker stack deploy` command
3839
* Use the `visualizer` to explore and understand the runtime app and services
3940
* Update the `docker-stack.yml` and redeploy the app using a different
4041
`vote` image to implement a poll on different choices
41-
* Use features new in Compose v.3, highlighted in the sample app
42+
* Use features new in Compose Version 3, highlighted in the sample app
4243

4344
## Anatomy of the voting app
4445

@@ -85,21 +86,19 @@ deployed after another service. In our example, `vote` only deploys
8586
after `redis`.
8687

8788
The `deploy` key specifies aspects of a swarm deployment, as described below in
88-
[Compose v.3 features and
89+
[Compose Version 3 features and
8990
compatibility](#compose-v3-features-and-compatibility).
9091

91-
## docker-stack.yml
92+
## docker-stack.yml deployment configuration
9293

93-
We'll deploy the app using `docker-stack.yml`, which is a
94-
type of [Compose file reference](/compose/compose-file.md)
95-
new in Compose v.3.
94+
We'll deploy the app using `docker-stack.yml`, which is a type of [Compose
95+
file](/compose/compose-file.md) new in Compose Version 3.
9696

97-
To follow along with the example, you need only have
98-
Docker running and the copy of `docker-stack.yml` we
99-
provide here. This file defines all the services shown
100-
in the [table above](#anatomy-of-the-voting-app), their
101-
base images, configuration details such as ports and networks,
102-
application dependencies, and the swarm configuration.
97+
To follow along with the example, you need only have Docker running and the copy
98+
of `docker-stack.yml` we provide here. This file defines all the services shown
99+
in the [table above](#anatomy-of-the-voting-app), their base images,
100+
configuration details such as ports and networks, application dependencies, and
101+
the swarm configuration.
103102

104103
```
105104
version: "3"
@@ -191,9 +190,9 @@ volumes:
191190
db-data:
192191
```
193192

194-
## Compose v.3 features and compatibility
193+
## Compose Version 3 features and compatibility
195194

196-
To deploy the voting application, we will use the `docker-stack deploy` command
195+
To deploy the voting application, we will run the `docker-stack deploy` command
197196
with this `docker-stack.yml` file to pull the referenced images and launch the
198197
services in a swarm as configured in the `.yml`.
199198

@@ -202,30 +201,31 @@ Note that at the top of the `docker-stack.yml` file, the version is indicated as
202201
designed to be cross-compatible with Compose and Docker Engine swarm mode.
203202

204203
Before we get started, let's take a look at some aspects of Compose files and
205-
deployment options that are new in Compose v.3, and that we want to highlight in
204+
deployment options that are new in Compose Version 3, and that we want to highlight in
206205
this walkthrough.
207206

208207
- [docker-stack.yml](#docker-stackyml)
209208
- [deploy key](#deploy-key)
210209
- [docker stack deploy command](#docker-stack-deploy-command)
211-
- [Application stacks and services](#application-stack-and-services)
210+
- [Docker stacks and services](#docker-stacks-and-services)
212211

213212
### docker-stack.yml
214213

215-
`docker-stack.yml` is a new type of Compose file only compatible with Compose
216-
v.3.
214+
`docker-stack.yml` is a new type of [Compose file](/compose/compose-file.md)
215+
only compatible with Compose Version 3.
217216

218217
#### deploy key
219218

220-
The `deploy` key allows you to specify various properties of
221-
a swarm deployment.
219+
The `deploy` key allows you to specify various properties of a swarm deployment.
222220

223-
For example, the voting app configuration uses this to
224-
create replicas of the `vote` and `result` services (2 containers of each will
225-
be deployed to the swarm).
221+
For example, the voting app configuration uses this to create replicas of the
222+
`vote` and `result` services (2 containers of each will be deployed to the
223+
swarm).
226224

227-
The voting app also uses the `deploy` key to
228-
constrain some services to run only on the manager node.
225+
The voting app also uses the `deploy` key to constrain some services to run only
226+
on the manager node.
227+
228+
For more about the `deploy key`, see [deploy](/compose/compose-file.md#deploy).
229229

230230
### docker stack deploy command
231231

@@ -239,26 +239,28 @@ builds based on a Dockerfile. You need to use pre-built images
239239
with `docker stack deploy`.
240240

241241
* It can take the place of running `docker compose up` to deploy
242-
v.3 compatible applications.
242+
Version 3 compatible applications.
243+
244+
See information about the [deploy](/compose/compose-file.md#deploy) key in the
245+
Compose file reference and [`docker stack
246+
deploy`](/engine/reference/commandline/stack_deploy.md) in the Docker Engine
247+
command line reference.
243248

244-
### Application stacks and services
249+
### Docker stacks and services
245250

246-
Taken together, these new features and deployment options can help when
251+
Taken together, these new Compose features and deployment options can help when
247252
mapping out distributed applications and clustering strategies. Rather than
248-
thinking about running individual containers, we can start to model
249-
Docker deployments as application stacks and services.
253+
thinking about running individual containers, we can start to model deployments
254+
as Docker stacks and services.
250255

251256
### Compose file reference
252257

253-
To learn more, see these topics in the [Compose file
254-
reference](/compose/compose-file.md):
255-
256-
* For more about `docker-stack.yml` and the `docker stack deploy` command, see
257-
[deploy](/compose/compose-file.md#deploy).
258+
For more on what's new in Compose Version 3 and how to upgrade, see these topics
259+
in the [Compose file reference](/compose/compose-file.md):
258260

259-
* For more on what's new in Compose v.3, see
260-
[Versioning](/compose/compose-file.md#versioning), [Version 3](/compose/compose-file.md#version-3), and
261-
[Upgrading](/compose/compose-file.md#upgrading).
261+
* [Versioning](/compose/compose-file.md#versioning)
262+
* [Version 3](/compose/compose-file.md#version-3)
263+
* [Upgrading](/compose/compose-file.md#upgrading)
262264

263265
## What's next?
264266

engine/getstarted-voting-app/test-drive.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Setup for voting app example
33
keywords: multi-container, services, swarm mode, cluster, voting app, docker-stack.yml, docker stack deploy
4-
title: Try out the voting app
4+
title: Try it out and vote
55
---
66

77
Now that the app is up and running, let's try it out.

0 commit comments

Comments
 (0)