Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aem99's avatar
Level 3

Migrations on ECS Fargate

Hi

I am in the process of converting an app from traditional ec2 to run on ECS Fargate. While I managed to get most of the major stuff to work, figuring out how to run migrations has bested me so far.

I considered just running the migration command at the startup script before starting nginx, but since I’ll have multiple instances, I elected to avoid this approach to steer clear of any weird concurrency issues.

The only possibly viable option I can think of is to lunch a one-off task that migrates the database then just shutdowns. The problem is that I have no clue how to do that. As in how to trigger that one-off task to run.

Any ideas are welcome! Thanks.

0 likes
1 reply
stephanepaul's avatar

sorry late but add a one off task to run the migrations, or add a start shell script to run the migrations before starting the app.

Please or to participate in this conversation.