Skip to content

Commit 18aa8ed

Browse files
committed
Merge remote-tracking branch 'origin/main' into postgres-docs
2 parents 0d420f3 + 781780d commit 18aa8ed

File tree

11 files changed

+228
-183
lines changed

11 files changed

+228
-183
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
55
### Installation
66

77
```
8-
$ npm
8+
$ npm install
99
```
10-
11-
### Local Development
10+
Make sure that you've cloned the `defanglabs/defang` repo and `defanglabs/samples` repo in sibling directories.
1211

1312
```
14-
$ npm serve
13+
$ git clone https://github.com/DefangLabs/defang.git ../defang
14+
$ git clone https://github.com/DefangLabs/samples.git ../samples
1515
```
1616

17-
This command starts a local development server and opens up a browser window.
18-
1917
### Build
2018

2119
```
22-
$ npm build
20+
$ npm run build
2321
```
2422

2523
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2624

25+
### Local Development
26+
27+
```
28+
$ npm run start
29+
```
30+
31+
This command starts a local development server and opens up a browser window.
32+
2733
### Deployment
2834

2935
Using SSH:

docs/concepts/compose.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You might be familiar with `docker-compose.yml` files, now known as the [Compose
1212

1313
You can define your [services](./services.md) using a `compose.yaml` file in the root of your project, or use the [`defang generate` command](../tutorials/generate-new-code-using-ai.mdx) to generate one (along with other resources). This file is used to define your application's services and how they run. You can edit this file to add more services or change the configuration of existing services.
1414

15-
When you run `defang up`, Defang will read your `compose.yaml` file and [deploy](./deployments.md) the services named in that file to the cloud.
15+
When you run `defang compose up`, Defang will read your `compose.yaml` file and [deploy](./deployments.md) the services named in that file to the cloud.
1616

1717
## Service Name Resolution
1818

@@ -41,4 +41,4 @@ secrets:
4141
4242
:::info Configuration & Secrets
4343
Read more about configuration in the [configuration page](./configuration.md) and about secrets in the [secrets page](./configuration.md).
44-
:::
44+
:::

docs/concepts/domains.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ You can also bring your own domain to a Defang project. This allows you to use y
7575

7676
### BYOC or Defang Playground
7777

78-
If you are using [Defang BYOC](./defang-byoc.md) and *do not* have your domain's DNS hosted with your cloud provider, you will need to follow this flow:
78+
If you are using [Defang BYOC](./defang-byoc.md) and *do not* have your domain's DNS hosted with your cloud provider, or if you are using the [Defang Playground](./defang-playground.md), you will need to follow this flow:
7979

8080
1. Add the `domainname` to your service definition.
8181
2. Run `defang compose up` to deploy your project.
8282
3. Run `defang cert generate` to generate an SSL certificate. This command will provide instructions for where to point your domain's DNS before the certificate can be issued.
8383

8484
### BYOC
8585

86-
If you are using [Defang BYOC](./defang-byoc.md) and the DNS for your domain is hosted with your cloud provider (i.e. a Hosted Zone in Route 53, if you're using AWS), all you need to do is specify the `domainname` in your service definition, as in the example below.
86+
If you are using [Defang BYOC](./defang-byoc.md) *and the DNS for your domain is hosted with your cloud provider* (i.e. a Hosted Zone in Route 53, if you're using AWS), all you need to do is specify the `domainname` in your service definition, as in the example below.
8787

8888
:::warning
8989
For the time being, you can only use one domain per service.

docs/concepts/observability.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Observability
2+
title: Observability
33
description: Monitor and debug your Defang services with the Defang CLI and portal.
44
sidebar_position: 600
55
---
66

77
# Observability
88

9-
You can easily monitor and debug your Defang services at build and runtime using the Defang CLI and portal.
9+
You can easily monitor and debug your Defang services at build and runtime using the Defang CLI and portal.
1010

11-
When you deploy a service using the `defang up` the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.
11+
When you deploy a service using the `defang compose up` the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.
1212

1313
:::warning
1414
Keep in mind that the Defang Portal only displays services deployed to Defang Playground.
@@ -25,4 +25,4 @@ defang tail --etag ua119053ehi2
2525

2626
## Architecture
2727

28-
In [BYOC](./defang-byoc.md), output is logged to the native logging tools within your cloud provider. The CLI then tails the output as needed.
28+
In [BYOC](./defang-byoc.md), output is logged to the native logging tools within your cloud provider. The CLI then tails the output as needed.

docs/faq.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,31 @@ secrets:
144144

145145
### "Stack:… is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS state and cannot be updated"
146146
- This happens if different version of the Defang CLI are used with the same AWS account. Each version one will try to update the CD stack to its version, back and forth. Make sure that all users have the same version of the CLI. Check the CLI version using `defang version`.
147+
148+
### "invalid healthcheck: ingress ports require an HTTP healthcheck on `localhost`.
149+
150+
- This message is displayed when `defang compose up` tries to deploy a service with an "ingress" port, if the service does not have a `healthcheck` which mentions `localhost`. Defang routes a load balancer to your service's ingress ports, and the loadbalancer needs to be able to check the health of the service. To solve this issue, ask yourself these two questions:
151+
152+
1. Should my service be public? It's common to declare your container's ports using the Compose file "shorthand" syntax (`1234:1234`). This syntax can be understood as `[HOST:]CONTAINER`. If your service is not intended to be public, you do not need to declare a HOST port. For example:
153+
154+
```diff
155+
services:
156+
my-service:
157+
image: my-image
158+
ports:
159+
- - "1234:1234"
160+
+ - "1234"
161+
```
162+
2. Does my healthcheck include the string `localhost`? It is very common to define a healthcheck by using `curl` or `wget` to make a request to `localhost`. So common, in fact, that defang will look for the string `localhost` in your healthcheck definition. For example, this healthcheck is valid:
163+
164+
```yaml
165+
healthcheck:
166+
test: ["CMD", "curl", "-f", "http://localhost:1234/health"]
167+
```
168+
169+
This healthcheck is not valid for `ingress` ports:
170+
171+
```yaml
172+
healthcheck:
173+
test: ["CMD", "./my-healthcheck"]
174+
```

docs/getting-started/getting-started.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ Defang supports various ways of creating and deploying services to the cloud. Th
4747
By default, all the output (stdout and stderr) from your app is logged. You can view these logs in real-time. You can view logs for all your services, one service, or even one specific deployment of a service.
4848

4949
- From the CLI:
50-
50+
5151
```tsx
5252
defang tail --name service1
5353
```
54-
54+
5555
- From the Defang Portal:
56-
57-
[https://portal.defang.dev/](https://portal.defang.dev/)
56+
57+
[https://portal.defang.dev/](https://portal.defang.dev/)
5858

5959

6060
:::info
6161
* To learn more about observability in Defang, check out the [observability page](../concepts/observability.md).
6262
* Note that the Defang Portal only displays services deployed to Defang Playground.
6363
:::
64-
64+
6565

6666
### Update Services
6767

@@ -70,4 +70,3 @@ To update your app (for example, updating the base image of your container, or m
7070
:::info
7171
If you are using [compose files](../concepts/compose.md) to define your services, you can add/remove services, make changes to code, etc. When you run `defang compose up`, the update will be diffed against the current state and any necessary changes will be applied to make the current state match the desired state.
7272
:::
73-

docs/getting-started/installing.md

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,49 @@ sidebar_position: 100
33
title: Installing
44
description: How to install Defang.
55
---
6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
68

7-
# Installing
9+
# How to Install Defang
810

911
Defang doesn't require installing anything in your cloud, but you will need to install the [open source](https://github.com/DefangLabs/defang) Defang command line interface (CLI) to interact with your Defang resources and account.
1012

11-
We offer a few different ways to install the Defang CLI. You can use Homebrew, a bash script, Winget, or download the binary directly.
13+
We offer a few different ways to install the Defang CLI. You can use a bash script, Homebrew, Winget, or you can download the binary directly.
1214

13-
## Using Homebrew
1415

15-
You can easily install the Defang CLI using [Homebrew](https://brew.sh/). Run the following command in your terminal:
16+
<Tabs>
17+
<TabItem value="bash" label="Bash">
18+
## Using a Bash Script
1619

17-
```bash
18-
brew install DefangLabs/defang/defang
19-
```
20+
You can install the Defang CLI using a bash script. Run the following command in your terminal:
2021

21-
## Using a Bash Script
22+
```bash
23+
. <(curl -Ls s.defang.io/install)
24+
```
2225

23-
You can install the Defang CLI using a bash script. Run the following command in your terminal:
26+
The script will try to download the appropriate binary for your operating system and architecture, add it to `~/.local/bin`, and add `~/.local/bin` to your `PATH` if it's not already there, with your permission. If you do not provide permission it will print an appropriate instruction for you to follow to add it manually. You can also customize the installation directory by setting the `INSTALL_DIR` environment variable before running the script.
27+
</TabItem>
28+
<TabItem value="homebrew" label="Homebrew" default>
29+
## Using Homebrew
2430

25-
```bash
26-
. <(curl -Ls s.defang.io/install)
27-
```
31+
You can easily install the Defang CLI using [Homebrew](https://brew.sh/). Run the following command in your terminal:
2832

29-
The script will try to download the appropriate binary for your operating system and architecture, add it to `~/.local/bin`, and add `~/.local/bin` to your `PATH` if it's not already there, with your permission. If you do not provide permission it will print an appropriate instruction for you to follow to add it manually. You can also customize the installation directory by setting the `INSTALL_DIR` environment variable before running the script.
33+
```bash
34+
brew install DefangLabs/defang/defang
35+
```
36+
</TabItem>
37+
<TabItem value="winget" label="Winget">
38+
## Using Winget
3039

31-
## Using Winget
40+
On Windows, you can install the Defang CLI using `winget`. Run the following command in your terminal:
3241

33-
On Windows, you can install the Defang CLI using `winget`. Run the following command in your terminal:
34-
35-
```powershell
36-
winget install defang
37-
```
38-
39-
## Direct Download
40-
41-
You can find the latest version of the Defang CLI on the [releases page](https://github.com/DefangLabs/defang/releases). Just download the appropriate binary for your operating system and architecture, and put it somewhere in your `PATH`.
42+
```powershell
43+
winget install defang
44+
```
45+
</TabItem>
46+
<TabItem value="direct" label="Direct Download">
47+
## Direct Download
4248

49+
You can find the latest version of the Defang CLI on the [releases page](https://github.com/DefangLabs/defang/releases). Just download the appropriate binary for your operating system and architecture, and put it somewhere in your `PATH`.
50+
</TabItem>
51+
</Tabs>

docusaurus.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const config = {
6565
logo: {
6666
alt: 'Defang Logo',
6767
src: '/img/defang-logo.svg',
68+
href: 'https://defang.io/',
6869
},
6970
items: [
7071
{

0 commit comments

Comments
 (0)