Skip to content

Commit e18a0e6

Browse files
committed
Merge remote-tracking branch 'origin/main' into september-compose-update
2 parents cc9d6ac + 6eece81 commit e18a0e6

File tree

6 files changed

+87
-8
lines changed

6 files changed

+87
-8
lines changed

docs/concepts/configuration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@ services:
4444
4545
Use the `defang config` command of the Defang CLI to manage the values.
4646

47+
## Interpolation
48+
49+
Environment variables are set within the *environment* section of a service in a `compose.yaml` file. Any variables declared here will become available within the service container.
50+
51+
Variables can be set by assigning a literal value, a reference to a configuration value, or a mix of literal and variable references. Variable references are declared using either **\$\{variable_name\}** or **$variable_name** forms. It is recommended to use the bracketed form. By interpolating over variable references within a string we can construct complex strings. Interpolation may be particularly useful when constructing connection strings to other services.
52+
53+
```
54+
service:
55+
environment:
56+
- USER_PASSWORD // configuration variable
57+
- USER_NAME // configuration variable
58+
- CONNECT=dbservice:${USER_NAME}:${USER_PASSWORD}@example.com:9876
59+
```
60+
In the example above, if we assume the value of the configuration variable ***USER_PASSWORD*** is *password* then the value assigned to ***CONNECT*** will resolve to *dbservice:alice:[email protected]:9876*
61+
62+
63+
During `defang compose up` all variable references will be replaced with the actual value and made available in the container. If any referenced variable is not found the `defang compose up` command will be canceled.
64+
4765
## Connecting Services
4866
4967
If you have created a service before a secret you can connect it by running the `defang compose start` command if using the [`defang compose` workflow](./compose.md). If you are using the [Pulumi-based workflow](./pulumi.md) you will need to redeploy using Pulumi.
@@ -57,3 +75,5 @@ You can find a sample of how to set sensitive config values [here](https://githu
5775
Here are the different ways sensitive config values are stored depending on the provider you are using:
5876
5977
* [AWS](../providers/aws/aws.md#secrets)
78+
79+

docs/concepts/generate.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ A simple next.js app that serves a static page
3838
A simple api with a single route built on express
3939
```
4040

41+
```
42+
An HTTP GET endpoint that returns an HTML with a random meme from the imgflip API
43+
```
44+
4145
**An example of a more complex prompt**
4246

4347
```

docs/concepts/managed-storage/managed-object-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Managed Object Storage, like AWS S3, is a service that allows you to store and r
1818
| --- | --- |
1919
| [Playground](/docs/providers/playground.md) ||
2020
| [AWS](/docs/providers/aws/aws.md) ||
21-
21+
| [DigitalOcean](/docs/providers/digital-ocean/digital-ocean.md) ||

docs/concepts/managed-storage/managed-postgres.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Postgres, or PostgreSQL, is an advanced open-source relational database system k
1414
| --- | --- |
1515
| [Playground](/docs/providers/playground) ||
1616
| [AWS](/docs/providers/aws/aws.md#managed-postgres) ||
17+
| [DigitalOcean](/docs/providers/digital-ocean/digital-ocean.md) ||
1718

1819
## How to use Managed Postgres
1920

@@ -44,10 +45,13 @@ You can connect to the managed Postgres instance using the name of your service
4445
POSTGRES_USER: postgres
4546
POSTGRES_DB: postgres
4647
// highlight-start
47-
# Note: by leaving the value empty, Defang will use the
48+
# Note: by leaving the value empty, Defang will use the
4849
# value set using `defang config set POSTGRES_PASSWORD`
4950
POSTGRES_PASSWORD:
5051
// highlight-end
52+
# Note: you can create a connection string by using interpolation,
53+
# reference config variables by using ${<config name>}
54+
CONNECTURL: postgresql://${POSTGRES_PASSWORD}@database:5432/postgres
5155
database:
5256
image: postgres:15
5357
x-defang-postgres: true
@@ -57,7 +61,7 @@ You can connect to the managed Postgres instance using the name of your service
5761
target: 5432
5862
environment:
5963
// highlight-start
60-
# Note: by leaving the value empty, Defang will use the
64+
# Note: by leaving the value empty, Defang will use the
6165
# value set using `defang config set POSTGRES_PASSWORD`
6266
POSTGRES_PASSWORD:
6367
// highlight-end

docs/concepts/managed-storage/managed-redis.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ sidebar_position: 2000
66

77
# Managed Redis
88

9-
Redis is an in-memory data structure store widely used for caching, real-time analytics, and session management due to its high performance, low latency, and support for various data types. Defang can help you provision a managed Redis instance.
9+
Redis is an in-memory data structure store widely used for caching, real-time analytics, and session management due to its high performance, low latency, and support for various data types. Defang can help you provision a managed Redis instance.
1010

1111
## Current Support
1212

1313
| Provider | Managed Redis |
1414
| --- | --- |
1515
| [Playground](/docs/providers/playground.md#managed-redis) ||
1616
| [AWS](/docs/providers/aws/aws.md#managed-redis) ||
17+
| [DigitalOcean](/docs/providers/digital-ocean/digital-ocean.md) ||
1718

1819
## How to use Managed Redis
1920

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,61 @@
11
---
2-
title: Digital Ocean
3-
description: Defang allows you to easily create and manage full, scalable applications with Digital Ocean.
4-
sidebar_position: 000
2+
title: DigitalOcean
3+
description: Defang allows you to easily create and manage full, scalable applications with DigitalOcean.
4+
sidebar_position: 010
55
---
66

77
# Digital Ocean
88

99
:::info
10-
V1 Defang BYOC Digital Ocean Provider is in private beta as of September 2024.
10+
This feature is available for Public Preview as of October 2024. This page will be updated when it is GA.
1111
:::
12+
13+
Why should you use Defang with DigitalOcean? Defang allows you to easily create and manage full, scalable applications with DigitalOcean. Defang aims to make it easier to deploy your services to the cloud. DigitalOcean is one of the most popular cloud providers in the world and with Defang, you dont have to waste your time understanding the complexities and challenges of the DigitalOcean platform. Let Defang do it for you and spend more time working on whats important to you!
14+
15+
## Getting Started
16+
To get started with the Defang BYOC DigitalOcean Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang). Next make sure you have signed up for a [DigitalOcean account](https://try.digitalocean.com/freetrialoffer/).
17+
18+
After signing up for your account, be sure to setup your [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) as well as your [Spaces access key](https://docs.digitalocean.com/products/spaces/how-to/manage-access/). Next, save these values as environment variables with the names `DIGITALOCEAN_TOKEN`, `SPACES_ACCESS_KEY_ID`, and `SPACES_SECRET_ACCESS_KEY`.
19+
20+
```bash
21+
export DIGITALOCEAN_TOKEN=<your-token>
22+
export SPACES_ACCESS_KEY_ID=<your-key-id>
23+
export SPACES_SECRET_ACCESS_KEY=<your-key>
24+
```
25+
26+
The Defang CLI will automatically check if they are set before running. Once you are ready to go, add the `--provider=digitalocean` to your command to tell the Defang CLI to use the DigitalOcean provider.
27+
28+
```bash
29+
$ defang up --provider=digitalocean
30+
# or
31+
$ export DEFANG_PROVIDER=digitalocean
32+
```
33+
34+
## Region
35+
36+
The Defang BYOC DigitalOcean Provider will use the region specified in the `REGION` environment variable. For a list of regions available in DigitalOcean, see the [region documentation](https://docs.digitalocean.com/platform/regional-availability/#app-platform-availability).
37+
38+
## Architecture
39+
40+
Defang uses resources that are native to the cloud provider you are using. The following describes the current state of Defang's support for DigitalOcean, the specific resources that Defang uses, and the roadmap for future support.
41+
42+
### Deployment
43+
44+
To deploy your services, the Defang CLI packages your code and uploads it to a [Spaces Object Storage](https://www.digitalocean.com/products/spaces) bucket in your account. The CLI then deploys an App Platform App that uses Pulumi to build your container image and run your service.
45+
46+
### Runtime
47+
48+
The Provider runs your workloads using the [DigitalOcean App Platform](https://docs.digitalocean.com/products/app-platform/).
49+
50+
### Secrets
51+
52+
Defang allows you to configure your services with sensitive config values. Sensitive values are added and stored with [encryption](https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/) in your app once it has been deployed.
53+
54+
### Future Improvements
55+
56+
The following features are still in development for DigitalOcean:
57+
- [Custom Domains](/docs/concepts//domains.mdx)
58+
- [Managed Redis](/docs/concepts//managed-storage/managed-redis.md)
59+
- [Managed Postgres](/docs/concepts/managed-storage/managed-postgres.md)
60+
61+
Stayed tuned for future updates!

0 commit comments

Comments
 (0)