DEV Community

Discussion on: Deploy Rails in Amazon ECS: Part 4 - Create an ECS Cluster

Collapse
 
kavitajadhav profile image
Kavita Jadhav • Edited

I accessed container terminal with command
docker exec -it <> /bin/bash

And as you mentioned, it recreated container every time I ran command:
rake db:create && rake db:migrate && rake db:seed

Alternative I tried and worked for me:
docker exec -it <> rake db:create
docker exec -it <> rake db:migrate
docker exec -it <> rake db:seed

It gave errors for first few times as I didn’t have all configurations for staging env in place. After fixing them above commands worked.

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Hi Kavita, those alternative commands work as well. In fact, I think your way might be easier since we don't have to enter the docker container anymore