Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01467c8

Browse files
Merge pull request docker#750 from joaofnfernandes/ddc-compose
Update DDC deploy app articles
2 parents 88154ea + 3faf289 commit 01467c8

File tree

9 files changed

+72
-50
lines changed

9 files changed

+72
-50
lines changed

datacenter/ucp/2.0/guides/applications/deploy-app-cli.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,61 @@
11
---
22
title: Deploy an app from the CLI
3-
description: Learn how to deploy containerized applications on a cluster, with Docker
3+
description: Learn how to deploy containerized applications on a swarm, with Docker
44
Universal Control Plane.
55
keywords:
66
- deploy, application
77
---
88

9-
# Deploy an app from the CLI
10-
119
With Docker Universal Control Plane you can deploy your apps from the CLI,
1210
using Docker Compose. In this example we're going to deploy a WordPress
1311
application.
1412

1513
## Get a client certificate bundle
1614

17-
Docker UCP secures your cluster with role-based access control, so that only
18-
authorized users can deploy applications to the cluster. To be able to run
19-
Docker commands on the UCP cluster, you need to authenticate your requests using
20-
client certificates.
15+
Docker UCP secures your Docker swarm with role-based access control, so that only
16+
authorized users can deploy applications. To be able to run
17+
Docker commands on a swarm managed by UCP, you need to authenticate your
18+
requests using client certificates.
2119

2220
[Learn how to set your CLI to use client certificates](../access-ucp/cli-based-access.md).
2321

2422
## Deploy WordPress
2523

2624
The WordPress application we're going to deploy is composed of two services:
2725

28-
* wordpress: The container that runs Apache, PHP, and WordPress.
26+
* wordpress: The service that runs Apache, PHP, and WordPress.
2927
* db: A MariaDB database used for data persistence.
3028

31-
<!-- would be better if this was a docker-compose v2 file-->
32-
3329
After setting up your terminal to authenticate using client certificates,
3430
create a file named `docker-compose.yml` with the following service definition:
3531

36-
```yml
37-
wordpress:
38-
image: wordpress
39-
links:
40-
- db:mysql
41-
ports:
42-
- 8080:80
43-
44-
db:
45-
image: mariadb
46-
environment:
47-
MYSQL_ROOT_PASSWORD: example
32+
```none
33+
version: '2'
34+
35+
services:
36+
db:
37+
image: mysql:5.7
38+
volumes:
39+
- db_data:/var/lib/mysql
40+
restart: always
41+
environment:
42+
MYSQL_ROOT_PASSWORD: wordpress
43+
MYSQL_DATABASE: wordpress
44+
MYSQL_USER: wordpress
45+
MYSQL_PASSWORD: wordpress
46+
47+
wordpress:
48+
depends_on:
49+
- db
50+
image: wordpress:latest
51+
ports:
52+
- "8000:80"
53+
restart: always
54+
environment:
55+
WORDPRESS_DB_HOST: db:3306
56+
WORDPRESS_DB_PASSWORD: wordpress
57+
volumes:
58+
db_data:
4859
```
4960

5061
In your command line, navigate to the place where you've created the
@@ -62,11 +73,11 @@ $ docker-compose --project-name wordpress ps
6273

6374
Name Command State Ports
6475
------------------------------------------------------------------------------------------
65-
wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
66-
wordpress_wordpress_1 /entrypoint.sh apache2-for ... Up 192.168.99.106:8080->80/tcp
76+
wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
77+
wordpress_wordpress_1 docker-entrypoint.sh apach ... Up 172.31.18.153:8000->80/tcp
6778
```
6879

69-
In this example, WordPress can be accessed at 192.168.99.106:8080. Navigate to
80+
In this example, WordPress can be accessed at 172.31.18.153:8000. Navigate to
7081
this address in your browser, to start using the WordPress app you just
7182
deployed.
7283

datacenter/ucp/2.0/guides/applications/index.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,51 @@ keywords:
77
---
88

99
With Docker Universal Control Plane you can deploy applications from the
10-
UI. You can define your application on the UI, or import an existing
11-
docker-compose.yml file.
12-
13-
In this example, we're going to deploy a WordPress application.
10+
UI using `docker-compose.yml` files. In this example, we're going to deploy a
11+
WordPress application.
1412

1513
## Deploy WordPress
1614

1715
On your browser, **log in** to UCP, and navigate to the **Applications** page.
18-
There, click the **Compose Application** button, to deploy a new application.
16+
There, click the **Deploy compose.yml** button, to deploy a new application.
1917

2018
![](../images/deploy-app-ui-1.png)
2119

2220
The WordPress application we're going to deploy is composed of two services:
2321

24-
* wordpress: The container that runs Apache, PHP, and WordPress.
22+
* wordpress: The service that runs Apache, PHP, and WordPress.
2523
* db: A MariaDB database used for data persistence.
2624

27-
<!-- would be better if this was a docker-compose v2 file-->
28-
29-
```yml
30-
wordpress:
31-
image: wordpress
32-
links:
33-
- db:mysql
34-
ports:
35-
- 8080:80
36-
37-
db:
38-
image: mariadb
39-
environment:
40-
MYSQL_ROOT_PASSWORD: example
25+
```none
26+
version: '2'
27+
28+
services:
29+
db:
30+
image: mysql:5.7
31+
volumes:
32+
- db_data:/var/lib/mysql
33+
restart: always
34+
environment:
35+
MYSQL_ROOT_PASSWORD: wordpress
36+
MYSQL_DATABASE: wordpress
37+
MYSQL_USER: wordpress
38+
MYSQL_PASSWORD: wordpress
39+
40+
wordpress:
41+
depends_on:
42+
- db
43+
image: wordpress:latest
44+
ports:
45+
- "8000:80"
46+
restart: always
47+
environment:
48+
WORDPRESS_DB_HOST: db:3306
49+
WORDPRESS_DB_PASSWORD: wordpress
50+
volumes:
51+
db_data:
4152
```
4253

43-
Copy-paste the application definition to UCP, and name it 'wordpress'.
54+
Name the application 'wordpress', and paste the docker-compose.yml definition.
4455
You can also upload a docker-compose.yml file from your machine, by clicking on
4556
the 'Upload an existing docker-compose.yml' link.
4657

@@ -58,7 +69,7 @@ exposing.
5869

5970
![](../images/deploy-app-ui-4.png)
6071

61-
In this example, WordPress can be accessed at `192.168.99.106:8080`.
72+
In this example, WordPress can be accessed at `172.31.18.152:8000`.
6273
Navigate to this address in your browser, to start using the WordPress app you
6374
just deployed.
6475

@@ -67,9 +78,9 @@ just deployed.
6778

6879
## Limitations
6980

70-
There are some limitations when deploying application on the UI. You can't
71-
reference any external files, so the following Docker Compose keywords are not
72-
supported:
81+
There are some limitations when deploying docker-compose.yml applications from
82+
the UI. You can't reference any external files, so the following Docker
83+
Compose keywords are not supported:
7384

7485
* build
7586
* dockerfile
134 KB
Loading
100 KB
Loading
222 KB
Loading
105 KB
Loading
145 KB
Loading
136 KB
Loading
173 KB
Loading

0 commit comments

Comments
 (0)