|
| 1 | +--- |
| 2 | +title: Deploy to AWS Fargate |
| 3 | +--- |
| 4 | + |
| 5 | +[AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances. With AWS Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers. This removes the need to choose server types, decide when to scale your clusters, or optimize cluster packing. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- **AWS Account**: Ensure you have an AWS account with the necessary permissions. |
| 10 | + |
| 11 | +## Steps |
| 12 | + |
| 13 | +### Step 1: Create an ECS Cluster |
| 14 | + |
| 15 | +1. Go to AWS Management Console and navigate to the ECS (Elastic Container Service). |
| 16 | +1. Click **Clusters** on the left menu and then click **Create cluster**. |
| 17 | +1. Fill in the cluster name, choose `AWS Fargate (serverless)` under **Infrastructure**. |
| 18 | +1. Click **Create**. |
| 19 | + |
| 20 | +### Step 2: Create an ECS Task Definition |
| 21 | + |
| 22 | +1. Click **Task Definitions** on the left menu and then click **Create new task definition**. |
| 23 | +1. Choose **AWS Fargate** as the launch type under **Infrastructure requirements**. |
| 24 | +1. Add a **Container**, fill in **Image URL** with `bytebase/bytebase:latest` and **Container port** `8080`. |
| 25 | +1. Click **Create**. |
| 26 | + |
| 27 | +### Step 3: Run the Task |
| 28 | + |
| 29 | +1. Go to the created cluster and click **Create** under **Services**. |
| 30 | +1. Under **Environment > Compute configuration**, choose **FARGATE** as the launch type. |
| 31 | +1. Under **Deployment configuration**, Choose `Service` as the **Application type**, choose the task definition you created in the previous step, give it a name such as `bytebase-service`. |
| 32 | +1. Click **Create**. |
| 33 | + |
| 34 | +### Step 4: Access Bytebase |
| 35 | + |
| 36 | +1. Go to the service you just created and click **Logs** tab to see the logs. If you see something like `Version 3.3.0(f5891735834ea82fd67bf8181597f86a7f5dab58) has started on port 8080 🚀`, it means Bytebase is running. |
| 37 | +1. Click **Tasks** tab to see the task list. Click the task name to see the task details. |
| 38 | +1. Under **Cointainer details for bytebase**, click **Network bindings** tab to find the **External link**. |
| 39 | +1. Click **Open address** to access Bytebase. |
| 40 | + |
| 41 | + |
0 commit comments