Skip to content

Commit

Permalink
Update DDC deploy app articles
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Fernandes committed Nov 30, 2016
1 parent 7d77fa4 commit 3faf289
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 50 deletions.
61 changes: 36 additions & 25 deletions datacenter/ucp/2.0/guides/applications/deploy-app-cli.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
---
title: Deploy an app from the CLI
description: Learn how to deploy containerized applications on a cluster, with Docker
description: Learn how to deploy containerized applications on a swarm, with Docker
Universal Control Plane.
keywords:
- deploy, application
---

# Deploy an app from the CLI

With Docker Universal Control Plane you can deploy your apps from the CLI,
using Docker Compose. In this example we're going to deploy a WordPress
application.

## Get a client certificate bundle

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

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

## Deploy WordPress

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

* wordpress: The container that runs Apache, PHP, and WordPress.
* wordpress: The service that runs Apache, PHP, and WordPress.
* db: A MariaDB database used for data persistence.

<!-- would be better if this was a docker-compose v2 file-->

After setting up your terminal to authenticate using client certificates,
create a file named `docker-compose.yml` with the following service definition:

```yml
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80

db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
```none
version: '2'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data:
```

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

Name Command State Ports
------------------------------------------------------------------------------------------
wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
wordpress_wordpress_1 /entrypoint.sh apache2-for ... Up 192.168.99.106:8080->80/tcp
wordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
wordpress_wordpress_1 docker-entrypoint.sh apach ... Up 172.31.18.153:8000->80/tcp
```

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

Expand Down
61 changes: 36 additions & 25 deletions datacenter/ucp/2.0/guides/applications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,51 @@ keywords:
---

With Docker Universal Control Plane you can deploy applications from the
UI. You can define your application on the UI, or import an existing
docker-compose.yml file.

In this example, we're going to deploy a WordPress application.
UI using `docker-compose.yml` files. In this example, we're going to deploy a
WordPress application.

## Deploy WordPress

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

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

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

* wordpress: The container that runs Apache, PHP, and WordPress.
* wordpress: The service that runs Apache, PHP, and WordPress.
* db: A MariaDB database used for data persistence.

<!-- would be better if this was a docker-compose v2 file-->

```yml
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80

db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
```none
version: '2'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data:
```

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

Expand All @@ -58,7 +69,7 @@ exposing.

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

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

Expand All @@ -67,9 +78,9 @@ just deployed.

## Limitations

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

* build
* dockerfile
Expand Down
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-cli-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified datacenter/ucp/2.0/guides/images/deploy-app-ui-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3faf289

Please sign in to comment.