-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from DefangLabs/postgres-docs
Postgres Docs
- Loading branch information
Showing
15 changed files
with
180 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"label": "Managed Storage", | ||
"position": 450, | ||
"collapsible": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: Managed Object Storage | ||
description: Defang can help you provision managed Redis instances. | ||
sidebar_position: 3000 | ||
--- | ||
|
||
# Managed Object Storage | ||
|
||
:::info Not Yet Supported | ||
As of September 2024, Defang does not yet support managed Object Storage, but it is on our roadmap. If you are interested in Object Storage support, please vote on [this issue](https://github.com/DefangLabs/defang/issues/688). | ||
::: | ||
|
||
Managed Object Storage, like AWS S3, is a service that allows you to store and retrieve large amounts of data. Object storage is ideal for storing unstructured data like images, videos, and backups. | ||
|
||
## Current Support | ||
|
||
| Provider | Managed Object Storage | | ||
| --- | --- | | ||
| [Playground](/docs/providers/playground.md) | ❌ | | ||
| [AWS](/docs/providers/aws/aws.md) | ❌ | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: Managed Postgres | ||
description: Defang can help you provision managed Postgres. | ||
sidebar_position: 1000 | ||
--- | ||
|
||
# Managed Postgres | ||
|
||
Postgres, or PostgreSQL, is an advanced open-source relational database system known for its robustness, extensibility, and compliance with SQL standards, making it a popular choice for complex applications requiring reliable data integrity and sophisticated querying capabilities. | ||
|
||
## Current Support | ||
|
||
| Provider | Managed Postgres | | ||
| --- | --- | | ||
| [Playground](/docs/providers/playground) | ❌ | | ||
| [AWS](/docs/providers/aws/aws.md#managed-postgres) | ✅ | | ||
|
||
## How to use Managed Postgres | ||
|
||
To use managed Postgres, in your `compose.yaml` file, use the `x-defang-postgres` extension to define your Postgres service. Adding the extension will tell Defang to provision a managed instance, rather than running Postgres as a service. | ||
|
||
### Required Configuration | ||
|
||
When using managed Postgres, you **must** set a password for the database using `defang config set POSTGRES_PASSWORD`. If you do not provide the password, the deployment will fail. You can can assign the password in the service's environment variables (to learn more about how this works, read about [configuration](../configuration.md)). | ||
|
||
### Optional Configuration | ||
|
||
You can also set the following environment variables to configure the managed Postgres instance: | ||
|
||
- `POSTGRES_USER`: The user for the managed Postgres instance. The default is `postgres`. | ||
- `POSTGRES_DB`: The database name for the managed Postgres instance. The default is `postgres`. | ||
|
||
### Connecting to Managed Postgres | ||
|
||
You can connect to the managed Postgres instance using the name of your service as the hostname, `POSTGRES_USER`, `POSTGRES_DB`, and `POSTGRES_PASSWORD` environment variables. | ||
|
||
### Example | ||
|
||
```yaml | ||
app: | ||
# [...] | ||
environment: | ||
POSTGRES_HOST: database | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
// highlight-start | ||
# Note: by leaving the value empty, Defang will use the | ||
# value set using `defang config set POSTGRES_PASSWORD` | ||
POSTGRES_PASSWORD: | ||
// highlight-end | ||
database: | ||
image: postgres:15 | ||
x-defang-postgres: true | ||
restart: unless-stopped | ||
ports: | ||
- mode: host | ||
target: 5432 | ||
environment: | ||
// highlight-start | ||
# Note: by leaving the value empty, Defang will use the | ||
# value set using `defang config set POSTGRES_PASSWORD` | ||
POSTGRES_PASSWORD: | ||
// highlight-end | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Managed Redis | ||
description: Defang can help you provision managed Redis instances. | ||
sidebar_position: 2000 | ||
--- | ||
|
||
# Managed Redis | ||
|
||
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. | ||
|
||
## Current Support | ||
|
||
| Provider | Managed Redis | | ||
| --- | --- | | ||
| [Playground](/docs/providers/playground.md#managed-redis) | ❌ | | ||
| [AWS](/docs/providers/aws/aws.md#managed-redis) | ✅ | | ||
|
||
## How to use Managed Redis | ||
|
||
To use managed Redis, in your `compose.yaml` file, use the `x-defang-redis` extension to define your Redis service. Adding the extension will tell Defang to provision a managed instance, rather than running Redis as a service. Defang will use the image tag to determine the version to provision from your cloud provider. Here's an example: | ||
|
||
```yaml | ||
cache: | ||
image: redis:6.2 | ||
x-defang-redis: true | ||
restart: unless-stopped | ||
ports: | ||
- mode: host | ||
target: 6379 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Managed Storage | ||
description: Defang can help you provision managed storage services. | ||
sidebar_position: 000 | ||
--- | ||
|
||
# Managed Storage | ||
|
||
Defang helps you provision the infrastructure you need to run your services. That infrastructure is designed to scale in and out without persistent storage, so you can build highly scalable services. But Defang can also help you provision managed services to store and persist your data, like [caches](./managed-redis.md), [databases](./managed-postgres.md), and [object storage](./managed-object-storage.md). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"label": "AWS", | ||
"position": 1000, | ||
"collapsible": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"label": "Digital Ocean", | ||
"position": 2000, | ||
"collapsible": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Digital Ocean | ||
description: Defang allows you to easily create and manage full, scalable applications with Digital Ocean. | ||
sidebar_position: 000 | ||
--- | ||
|
||
# Digital Ocean | ||
|
||
:::info | ||
V1 Defang BYOC Digital Ocean Provider is in private beta as of September 2024. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters