How to install metabase with aws ecs docker fargate

Devran AYDIN
2 min readAug 30, 2019

--

  1. Create your own cluster with a unique name with the following command :
  • aws ecs create-cluster --cluster-name fargate-cluster-name
{
"family": "$fargate-cluster-name",
"taskRoleArn": "arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"executionRoleArn": "arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole",
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "512",
"memory": "4096",
"containerDefinitions": [
{
"image": "metabase/metabase",
"name": "metabase",
"cpu": 2,
"memory": 2048,
"essential": true,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/metabase",
"awslogs-region": "eu-west-1",
"awslogs-stream-prefix": "ecs"
}
},
"portMappings": [
{
"containerPort": 3000,
"hostPort": 3000
}
],
"environment": [
{
"name": "MB_DB_DBNAME",
"value": "metabase"
},
{
"name": "MB_DB_HOST",
"value": "$DB_ENDPOINT"
},
{
"name": "MB_DB_PASS",
"value": "$DB_PASSWORD"
},
{
"name": "MB_DB_PORT",
"value": "5432"
},
{
"name": "MB_DB_TYPE",
"value": "postgres"
},
{
"name": "MB_DB_USER",
"value": "metabase"
}
],
"ulimits": [
{
"name": "nofile",
"softLimit": 32000,
"hardLimit": 32000
}
]
}
]

}

2. write $fargate-cluster-name ,$ACCOUNT_ID , $DB_ENDPOINT and $DB_PASSWORD

3. JSON file for container definitions:

  • aws ecs register-task-definition --cli-input-json file://$HOME/tasks/fargate-task.json

Now task is ready.

Create your Application Load Balancer and Target Groups

  • Load balancer
  • Target Group

Create Security Groups

*  Security for postgresql Rds
* Elb Security Groups
* Create for Security Group for Application

Create Service

  1. Step

2. Step

3. Step

--

--

No responses yet