> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/overview-2/azure-services/docker-web-application.md).

# Docker Web Application

## Introduction <a href="#id-0-toc-title" id="id-0-toc-title"></a>

In this demo, we will deploy a simple Hello World NodeJS web app. DuploCloud pulls Docker images from Docker Hub. You can choose a public image or provide credentials to access your private repository. For the sake of this demo, we will use a ready-made image available on DuploCloud’s repository on Docker Hub.

1. Create a new Host
2. Create a Service
3. Create a Load Balancer

## Step 1: Create a new host <a href="#id-1-toc-title" id="id-1-toc-title"></a>

1. Login to your DuploCloud console.
2. Click on **Cloud Services** -> **Hosts**
3. Select the **Host** tabs. A Host is an instance in which your Docker container will run. You should choose a Host with the appropriate processing capacity for your application.

You should see the Host listed under the Hosts Listing table.

## Step 2: Create a service <a href="#id-2-toc-title" id="id-2-toc-title"></a>

Next, we can create a Service. A Service is nothing but a container with user-specified image and environment variables.

1. Navigate to **Docker** -> **Services**.
2. Click **Add**, the **Add Service** page displays.
3. Name the service “**test-service**“. For this demo, we will use the latest, nodejs-hello image from Duplo’s public Docker hub repository. Fill in `duplocloud/nodejs-hello:latest` in the Docker Image field.
4. Enter the desired number of replicas you want in the swarm. Please note that each replica runs in an individual Host. The number of replicas must equal the number of Hosts. For the sake of this demo, we will choose 1.
5. Fill in the desired environment variables, this is ideal for credentials or application specific configurations.
6. Click **Next**. The **Advanced** options display.
7. Volume mapping is super easy, simply give the host path and container path as shown.
8. Click **Create** to create the Service.

{% hint style="info" %}
**NOTICE:** We highly recommend keeping the Hosts stateless and using Azure Storage for static assets. We will keep this field empty for this demo.
{% endhint %}

## Step 3: Create a load balancer <a href="#id-3-toc-title" id="id-3-toc-title"></a>

Almost there. Since the hello-nodejs image serves on port 3000 we need to create a load balancer (LB) configuration to map the external port (LB) to the internal port (container).

Select the Test-service and click the plus icon on the load balancer configuration table. Fill the menu as shown below and click submit.

<div align="left"><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FJ9nDkAByM0dpmqRrWLLV%2Fimage.png?alt=media&amp;token=350b63db-0e98-44ff-b003-43a3c9e25aeb" alt=""></div>

Please wait for \~5 minutes as it can take a while for the Load Balancer to get provisioned.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview-2/azure-services/docker-web-application.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
