-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better examples to show Compose file structure, expand/collapse accordion #3967
Merged
londoncalling
merged 8 commits into
docker:master
from
londoncalling:compose-file-structure
Jul 28, 2017
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2af9e8c
better examples to show Compose file structure
446d82b
cleaned up leading spaces in Compose file example
837cf46
cleaned up leading spaces, added a test file
4616a90
expand/collapse accordion full implementation, explanation in test.md
dae14e8
delete temporary test file from PR
eb90456
fix accordion to work on mobile (cursor style)
34b9385
verified fix for mobile worked, added same to test.md, updated notes …
3effb06
Clarifed details on test page, fixed references for FontAwesome icons
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
expand/collapse accordion full implementation, explanation in test.md
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,111 +46,105 @@ topic on [Deploying an app to a | |
Swarm](https://github.com/docker/labs/blob/master/beginner/chapters/votingapp.md). | ||
Click to show/hide the example Compose file below. | ||
|
||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading" role="tab" id="headingThree"> | ||
<h5 class="panel-title" id="collapsible-group-item-3"> <a class="" role="button" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" aria-expanded="true" aria-controls="collapseThree"> Example Compose file version 3 <i class="fa fa-chevron-down"></i></a> </h5> | ||
</div> | ||
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree" aria-expanded="true"> | ||
<div class="panel-body"> | ||
<pre><code> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading collapsed" data-toggle="collapse" data-target="#collapseSample1"> | ||
Example Compose file version 3 | ||
<i class="chevron fa fa-fw"></i></div> | ||
<div class="collapse block" id="collapseSample1"> | ||
<pre><code> | ||
version: "3" | ||
services: | ||
|
||
redis: | ||
image: redis:alpine | ||
ports: | ||
- "6379" | ||
networks: | ||
- frontend | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
db: | ||
image: postgres:9.4 | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
networks: | ||
- backend | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
vote: | ||
image: dockersamples/examplevotingapp_vote:before | ||
ports: | ||
- 5000:80 | ||
networks: | ||
- frontend | ||
depends_on: | ||
- redis | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
restart_policy: | ||
condition: on-failure | ||
result: | ||
image: dockersamples/examplevotingapp_result:before | ||
ports: | ||
- 5001:80 | ||
networks: | ||
- backend | ||
depends_on: | ||
- db | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
worker: | ||
image: dockersamples/examplevotingapp_worker | ||
networks: | ||
- frontend | ||
- backend | ||
deploy: | ||
mode: replicated | ||
replicas: 1 | ||
labels: [APP=VOTING] | ||
restart_policy: | ||
condition: on-failure | ||
delay: 10s | ||
max_attempts: 3 | ||
window: 120s | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
visualizer: | ||
image: dockersamples/visualizer:stable | ||
ports: | ||
- "8080:8080" | ||
stop_grace_period: 1m30s | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
redis: | ||
image: redis:alpine | ||
ports: | ||
- "6379" | ||
networks: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Almost there. Network and volumes need to be aligned with services, so you need to remove 2 spaces from lines 141-146 |
||
- frontend | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
db: | ||
image: postgres:9.4 | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
networks: | ||
- backend | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
vote: | ||
image: dockersamples/examplevotingapp_vote:before | ||
ports: | ||
- 5000:80 | ||
networks: | ||
- frontend | ||
depends_on: | ||
- redis | ||
deploy: | ||
replicas: 2 | ||
update_config: | ||
parallelism: 2 | ||
restart_policy: | ||
condition: on-failure | ||
result: | ||
image: dockersamples/examplevotingapp_result:before | ||
ports: | ||
- 5001:80 | ||
networks: | ||
- backend | ||
depends_on: | ||
- db | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 2 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
worker: | ||
image: dockersamples/examplevotingapp_worker | ||
networks: | ||
- frontend | ||
- backend | ||
deploy: | ||
mode: replicated | ||
replicas: 1 | ||
labels: [APP=VOTING] | ||
restart_policy: | ||
condition: on-failure | ||
delay: 10s | ||
max_attempts: 3 | ||
window: 120s | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
visualizer: | ||
image: dockersamples/visualizer:stable | ||
ports: | ||
- "8080:8080" | ||
stop_grace_period: 1m30s | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
deploy: | ||
placement: | ||
constraints: [node.role == manager] | ||
|
||
networks: | ||
frontend: | ||
backend: | ||
frontend: | ||
backend: | ||
|
||
volumes: | ||
db-data: | ||
</code></pre> | ||
</div> | ||
db-data: | ||
</code></pre> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
## Service configuration reference | ||
|
||
The Compose file is a [YAML](http://yaml.org/) file defining | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use
background-color
?background
is a hybrid which can take a color and an image together. This is a nit but it's more correct.