diff --git a/docs/concepts/railpack.md b/docs/concepts/railpack.md index aae599425..deb496651 100644 --- a/docs/concepts/railpack.md +++ b/docs/concepts/railpack.md @@ -148,7 +148,7 @@ services: | Provider | Railpack Support | |----------------|:----------------:| -| Playground | ❌ | +| Playground | ✅ | | AWS | ✅ | | DigitalOcean | ❌ | | GCP | ✅ | diff --git a/docs/tutorials/deploy-to-aws.mdx b/docs/tutorials/deploy-to-aws.mdx index fa777c5c8..b9232b443 100644 --- a/docs/tutorials/deploy-to-aws.mdx +++ b/docs/tutorials/deploy-to-aws.mdx @@ -7,25 +7,33 @@ description: Defang allows you deploy to your own Amazon Web Services (AWS) acco This tutorial will show you how to deploy your services to your own AWS account using Defang. -## Pre-requisites -* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) -* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) -* [A Defang Account](/docs/concepts/authentication) -* [The Defang CLI](/docs/getting-started#install-the-defang-cli) -* [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html) +## Prerequisites + +- [The Defang CLI](/docs/getting-started#install-the-defang-cli) +- [A Defang Account](/docs/concepts/authentication) +- [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html) +- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) +- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md) + +:::warning["MCP prerequisite"] +If you would like to deploy using [MCP](https://modelcontextprotocol.io/), you like need to setup the [Defang MCP Server](../concepts/mcp.md) with the IDE of your choice. +::: ## Step 1 - Navigate to your project directory + Head to the folder where your project is located. + ```bash $ cd path/to/your/project ``` -## Step 2 - Authenticate Defang to use your AWS Account +## Step 2 - Configure your AWS credentials -There are many ways to authenticate your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html). +There are many ways to authenticate with your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html). Once you've done that, Defang will look for your AWS credentials in your shell environment and expect to find one of the following credential sets: -* the `AWS_PROFILE` environment variable -* or, the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` environment variables + +- the `AWS_PROFILE` environment variable, and optionally the `AWS_REGION` environment variable +- or, the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` environment variables :::tip If you have the AWS CLI installed (which is not required in order to use the Defang CLI), you can verify that you've authenticated to AWS by running `aws sts get-caller-identity` and see your account ID. @@ -41,10 +49,10 @@ For example: $ defang compose up --provider=aws ``` -## Step 4 - Inspect your deployment +### Step 4 - Inspect your deployment Defang will provision resources in your AWS account and deploy your services. You can inspect the resources created in your AWS Dashboard. -*** +--- For a deeper discussion of the Defang AWS Architecture, including a list of the resources we provision in your account, see our [AWS Provider docs](/docs/providers/aws). diff --git a/docs/tutorials/deploy-to-gcp.mdx b/docs/tutorials/deploy-to-gcp.mdx index 132163d31..4f2bd7dfe 100644 --- a/docs/tutorials/deploy-to-gcp.mdx +++ b/docs/tutorials/deploy-to-gcp.mdx @@ -7,21 +7,28 @@ description: Defang allows you deploy to your own Google Cloud Platform (GCP) ac This tutorial will show you how to deploy your services to your own GCP project using Defang. -## Pre-requisites -* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) -* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) -* [A Defang Account](/docs/concepts/authentication) -* [The Defang CLI](/docs/getting-started#install-the-defang-cli) -* [gcloud CLI](https://cloud.google.com/sdk/docs/install) -* [GCP Account Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment) +## Prerequisites + +- [The Defang CLI](/docs/getting-started#install-the-defang-cli) +- [A Defang Account](/docs/concepts/authentication) +- [gcloud CLI](https://cloud.google.com/sdk/docs/install) +- [GCP Application Default Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment) +- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) +- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md) + +:::warning["MCP prerequisite"] +If you would like to deploy using [MCP](https://modelcontextprotocol.io/), you like need to setup the [Defang MCP Server](../concepts/mcp.md) with the IDE of your choice. +::: ## Step 1 - Navigate to your project directory + Head to the folder where your project is located. + ```bash $ cd path/to/your/project ``` -## Step 2 - Authenticate Defang to use your GCP Account +## Step 2 - Configure your GCP credentials After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. @@ -39,6 +46,6 @@ $ defang compose up --provider=gcp Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your [GCP Dashboard](https://console.cloud.google.com/). -*** +--- For a deeper discussion of the Defang GCP Architecture, see our [GCP docs](/docs/providers/gcp). diff --git a/docs/tutorials/deploy-to-playground.mdx b/docs/tutorials/deploy-to-playground.mdx index b2f458724..68b940d6b 100644 --- a/docs/tutorials/deploy-to-playground.mdx +++ b/docs/tutorials/deploy-to-playground.mdx @@ -7,19 +7,24 @@ description: Deploy to the free Defang Playground. This tutorial will show you how to deploy your project to the free [Defang Playground](/docs/concepts/defang-playground). -## Pre-requisites -* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) -* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) -* [A Defang Account](/docs/concepts/authentication) -* [The Defang CLI](/docs/getting-started#install-the-defang-cli) +## Prerequisites + +- [The Defang CLI](/docs/getting-started#install-the-defang-cli) +- [A Defang Account](/docs/concepts/authentication) +- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) +- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md) + +## CLI + +### Step 1 - Navigate to your project directory -## Step 1 - Navigate to your project directory Head to the folder where your project is located. + ```bash $ cd path/to/your/project ``` -## Step 2 - Deploy +### Step 2 - Deploy ``` $ defang compose up @@ -53,6 +58,12 @@ When you do this, you should see something similar to the output below: * Done. ``` +You can also check on your deployment on the on the [Defang portal](#defang-portal) as well. + +--- + +## Defang Portal + Now we can go to [https://portal.defang.dev/service/app](https://portal.defang.dev/service/app) to see our service listed in the Defang portal. ![screenshot of the defang portal](/img/getting-started-portal.png) diff --git a/docs/tutorials/deploying-with-the-defang-mcp-server.md b/docs/tutorials/deploying-with-the-defang-mcp-server.md new file mode 100644 index 000000000..fd68df973 --- /dev/null +++ b/docs/tutorials/deploying-with-the-defang-mcp-server.md @@ -0,0 +1,103 @@ +# Deploying with the Defang MCP Server + +This tutorial will show you how to deploy your services with the [Defang MCP Server](/docs/concepts/mcp.md). + +## Prerequisites + +- [The Defang MCP Server](/docs/concepts/mcp.md#installation) +- [A Defang Account](/docs/concepts/authentication) +- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/) + +Open your project with an IDE that has the [Defang MCP Server](/docs/concepts/mcp.md) installed. + +:::tip +If the Defang MCP server doesn’t start automatically, try starting or restarting it from your IDE settings. +![VS Code](/img/prompts/start-server.png) +::: + +## AWS + +### Step 1 - Collect your credentials + +There are many ways to authenticate with your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html). + +:::tip +If you have the AWS CLI installed, you can verify that you've authenticated to AWS by running `aws sts get-caller-identity` and see your account ID. (The AWS CLI is not required in order to use Defang with AWS) +::: + +### Step 2 - Setup Defang for AWS + +Open your chat window and type `/defang.AWS_Setup`, or select the corresponding prompt from your IDE’s options. + +![Trigger Prompt](/img/prompts/aws-prompt.png) + +The [MCP prompt](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts) accepts two types of credentials: + +1. Method 1 - Using an AWS Profile: + The following prompt will have three arguments and only the first argument is required: + + - AWS Credential - REQUIRED : The name of the AWS profile you want to use (e.g., "default" or "my-profile"). ![AWS Profile argument](/img/prompts/aws-profile-arg.png) + - AWS_SECRET_ACCESS_KEY - IGNORE : Leave this argument blank and press Enter. ![Ignore AWS Secret Access Key argument](/img/prompts/aws-ignore_secret.png) + - AWS_REGION - OPTIONAL : The AWS region where you want to deploy your services (e.g., "us-west-2"). ![AWS Region argument Optional](/img/prompts/aws-optional-region.png) + +2. Method 2 - Using Access Keys: + The following prompt will have three arguments and all three arguments are required: + + - AWS Credential - REQUIRED : The AWS Access Key ID (e.g., "AKIAIOSFODNN7EXAMPLE"). ![AWS Access Key ID argument](/img/prompts/aws-access-key-arg.png) + - AWS_SECRET_ACCESS_KEY - REQUIRED : The AWS Secret Access Key. (e.g., "wJalrXUtnFEMI/K7MDENG/bPExampleSecretKey").![AWS Secret Access Key argument](/img/prompts/aws-secret-key-arg.png) + - AWS_REGION - REQUIRED : The AWS region where you want to deploy your services (e.g., "us-west-2"). ![AWS Region argument](/img/prompts/require-aws-region-arg.png) + +### Step 3 - Deploy + +Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the IDE to execute. + +### Step 4 - Inspect your deployment + +You can check the status of your deployment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the resources created in your AWS Dashboard. + +## GCP + +### Prerequisites + +- [gcloud CLI](https://cloud.google.com/sdk/docs/install) +- [GCP Application Default Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment) + +### Step 1 - Collect your credentials + +After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID for the next step. + +### Step 2 - Setup Defang for GCP + +In your chat window, type `/defang.GCP_Setup` or select the corresponding prompt from your IDE’s options. + +![Trigger Prompt](/img/prompts/gcp-prompt.png) + +The [MCP argument](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts) will require your GCP project ID you created in [Step 1](#step-1---collect-your-credentials-1). +![GCP Project ID](/img/prompts/gcp-project-id.png) + +### Step 3 - Deploy + +Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the IDE to execute. + +### Step 4 - Inspect your deployment + +You can check the status of your depolyment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the resources created in your GCP Dashboard. + +## Playground + +### Step 1 - Setting your provider + +In your chat window, type `/defang.Playground_Setup` or select the corresponding prompt from your IDE’s options. + +![Trigger Prompt](/img/prompts/playground-prompt.png) + +There are no arguments to this prompt. + +### Step 2 - Deploy + +Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the LLM to execute. + +### Step 3 - Inspect your deployment + +You can check the status of your deployment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the the project on the [Defang portal](https://portal.defang.io/projects). +![screenshot of the defang portal](/img/getting-started-portal.png) diff --git a/static/img/prompts/aws-access-key-arg.png b/static/img/prompts/aws-access-key-arg.png new file mode 100644 index 000000000..a87b8a63a Binary files /dev/null and b/static/img/prompts/aws-access-key-arg.png differ diff --git a/static/img/prompts/aws-ignore_secret.png b/static/img/prompts/aws-ignore_secret.png new file mode 100644 index 000000000..f50c6f172 Binary files /dev/null and b/static/img/prompts/aws-ignore_secret.png differ diff --git a/static/img/prompts/aws-optional-region.png b/static/img/prompts/aws-optional-region.png new file mode 100644 index 000000000..b47ff4fb2 Binary files /dev/null and b/static/img/prompts/aws-optional-region.png differ diff --git a/static/img/prompts/aws-profile-arg.png b/static/img/prompts/aws-profile-arg.png new file mode 100644 index 000000000..0a6359fbb Binary files /dev/null and b/static/img/prompts/aws-profile-arg.png differ diff --git a/static/img/prompts/aws-prompt.png b/static/img/prompts/aws-prompt.png new file mode 100644 index 000000000..989da130f Binary files /dev/null and b/static/img/prompts/aws-prompt.png differ diff --git a/static/img/prompts/aws-secret-key-arg.png b/static/img/prompts/aws-secret-key-arg.png new file mode 100644 index 000000000..15525848d Binary files /dev/null and b/static/img/prompts/aws-secret-key-arg.png differ diff --git a/static/img/prompts/gcp-project-id.png b/static/img/prompts/gcp-project-id.png new file mode 100644 index 000000000..0512e6edf Binary files /dev/null and b/static/img/prompts/gcp-project-id.png differ diff --git a/static/img/prompts/gcp-prompt.png b/static/img/prompts/gcp-prompt.png new file mode 100644 index 000000000..a51a50dda Binary files /dev/null and b/static/img/prompts/gcp-prompt.png differ diff --git a/static/img/prompts/playground-prompt.png b/static/img/prompts/playground-prompt.png new file mode 100644 index 000000000..409f4362e Binary files /dev/null and b/static/img/prompts/playground-prompt.png differ diff --git a/static/img/prompts/require-aws-region-arg.png b/static/img/prompts/require-aws-region-arg.png new file mode 100644 index 000000000..060a96458 Binary files /dev/null and b/static/img/prompts/require-aws-region-arg.png differ diff --git a/static/img/prompts/start-server.png b/static/img/prompts/start-server.png new file mode 100644 index 000000000..1148e25f9 Binary files /dev/null and b/static/img/prompts/start-server.png differ