Skip to content
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
merged 8 commits into from
Jul 28, 2017
Prev Previous commit
Next Next commit
expand/collapse accordion full implementation, explanation in test.md
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
  • Loading branch information
Victoria Bialas committed Jul 28, 2017
commit 4616a90972ccbb67a81825cab1d99ee09a298eba
13 changes: 13 additions & 0 deletions _scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ img.inline {
display: inline;
}

.panel-heading .chevron:after {
content: "\f0d8";
}

.panel-heading.collapsed .chevron:after {
content: "\f0d7";
}

.panel-heading:hover{
background: #fafdfe;

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.

}


/*
* Search *********************************************************************
*
Expand Down
184 changes: 89 additions & 95 deletions compose/compose-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down
Loading