Self Hosted Deployment on ECS Using CF

Hi,

i am trying to deploy retool on ecs using cf with local database. i don't want to use rds as i am exploring retool for. i am using image tryretool/backend:3.33.16-stable for retool and in my taskdefinition i am using postgress images but i when deploying ecs task i am facing error:

May 03, 2024 at 13:23 (UTC+5:30) Failing checking database migrations retool
May 03, 2024 at 13:23 (UTC+5:30) --------------------------- retool
May 03, 2024 at 13:23 (UTC+5:30) - EXITING RETOOL - retool
May 03, 2024 at 13:23 (UTC+5:30) --------------------------- retool
May 03, 2024 at 13:23 (UTC+5:30) Error running database migrations: SequelizeConnectionError: database "retool" does not exist retool
May 03, 2024 at 13:23 (UTC+5:30) {"level":"info","message":"[process service types] DB_CONNECTOR, DB_SSH_CONNECTOR, MAIN_BACKEND, JOBS_RUNNER, WORKFLOW_WORKER","timestamp":"2024-05-03T07:53:46.519Z"} retool
May 03, 2024 at 13:23 (UTC+5:30) sed: can't read ./dist/mobile/*.js: No such file or directory retool
May 03, 2024 at 13:23 (UTC+5:30) not untarring the bundle

Here is my taskdefintion:

RetoolTaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: 'retool-task'
ExecutionRoleArn: 'arn:aws:iam::501168932878:role/ecsTaskExecutionRole'
RequiresCompatibilities:
- FARGATE
NetworkMode: awsvpc
Cpu: '2048'
Memory: '4096'
ContainerDefinitions:
- Name: 'retool'
Image: tryretool/backend:3.33.16-stable
DependsOn:
- ContainerName: postgres
Condition: HEALTHY
Essential: true
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref RetoolECSLogGroup
awslogs-region: !Ref Region
awslogs-stream-prefix: ecs
Environment:
- Name: DATABASE_URL
Value: postgres://postgres:password@postgres:5432/retool
- Name: LICENSE_KEY
Value: !Ref LicenseKey
- Name: JWT_SECRET
Value: !Ref JwtSecret
PortMappings:
- ContainerPort: 3000
- Name: postgres
Image: postgres:11
Command: ["postgres", "-c", "log_statement=all"]
Essential: true
PortMappings:
- ContainerPort: 5432
Environment:
- Name: POSTGRES_PASSWORD
Value: password
- Name: POSTGRES_DB
Value: retool
HealthCheck:
Command: ['CMD-SHELL', 'pg_isready -U postgres']
Interval: 30
Timeout: 5
Retries: 3
StartPeriod: 0

what changes are required here

Hey @Sonam_Rana, just to confirm you are attempting to use a Postgres db hosted on your local (as in your personal machine) machine?

I don't believe that this is possible, the networking configuration setup with the ECS deployment is expecting an RDS instance.

If you are truly just trying to explore Retool, I'd recommend starting with our simple EC2 deployment, using a containerized version of postgres for the DB (it's included in the docker-compose.yaml file already). This will allow you to spin up an instance of Retool without also having to use an RDS instance.

In fact you can use those steps to deploy locally as well, and you wouldn't even need to use an EC2 instance.

Hey @joeBumbaca
Thanks for the response. Well what i am trying to do is : i am trying to deploy retool on AWS ECS with retool local database which is postgresql. For that deployment i have the above error.

Just to let you know that i am able to deploy retool on AWS ECS with retool local database(postgresql). Currently the problem i am facing is that tha app is not accessible

From the network i suspects it is giving 401 error.

Also /api/checkHealth/ is giving:

Can you provide any insights on this topic?