Skip to content

Commit 1c85f2a

Browse files
committed
improve "deploy existing containers" page
1 parent 77e5064 commit 1c85f2a

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

docs/tutorials/deploy-container-using-the-cli.mdx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,48 @@ sidebar_position: 200
55

66
# Deploy Existing Containers
77

8-
This example is useful if you already have a Docker container built manually or through a CI/CD system and have that the resulting image is available in a public or private repository accessible by Defang.
8+
This tutorial will show you how to deploy an existing container/multi-container application.
9+
10+
This example is rather useful if you already have a Docker container built manually, or through a CI/CD system where the resulting image is available in a public or private repository accessible by Defang.
11+
But it is not required in order to follow along to this tutorial.
12+
13+
# Step 1 - Make a Docker Compose file
14+
:::tip
15+
If you are unfamiliar with Docker Compose files, check out the [Compose](/docs/concepts/compose) page.
16+
:::
17+
Create a `compose.yaml` file to define the [service(s)](/docs/concepts/services) in your application.
18+
19+
If you already have a Docker Compose file to define your service(s), you can use it directly and skip this step.
920

10-
# Step 1 - Docker Compose
11-
If you already have a Docker Compose file for your service(s) you can use it directly. Else you can create one like this:
1221

1322
```yaml
1423
version: '3.9'
1524
services:
16-
service1:
17-
# This is just an example, replace with the image you want
18-
image: "docker.io/nginx:latest"
25+
web:
26+
image: nginx:latest
1927
ports:
2028
- mode: ingress
2129
target: 3000
30+
app:
31+
build:
32+
context: .
33+
dockerfile: Dockerfile
34+
ports:
35+
- mode: ingress
36+
target: 4000
37+
redis:
38+
image: redis:6.2
39+
restart: unless-stopped
40+
ports:
41+
- mode: host
42+
target: 6379
2243
```
2344
45+
The example above shows a multi-container application with 3 services, `web`, `app`, `redis`.
46+
If you wanted to deploy only one container, say `app`, then the example would remain the same, except without the `web` and `redis` services.
47+
2448
# Step 2 - Deploy
49+
Run the following command in the [Defang CLI]((/docs/getting-started#install-the-defang-cli.md)).
2550
```text
2651
defang compose up
2752
```

0 commit comments

Comments
 (0)