This is my CDK code
const laravelCommand = [
"php",
"artisan",
"migrate"
]
taskDefinition.addContainer(`${projectName}-${imageName}-container-${env}`, {
containerName: `${projectName}-${imageName}-container-${env}`,
image: ecs.ContainerImage.fromEcrRepository(props.laravelApiEcr, 'latest'),
logging: laravelApiLogDriver,
environment: {
...envValues.environmentVariables,
},
portMappings: [
{
containerPort: 80,
hostPort: 80,
protocol: ecs.Protocol.TCP
}
],
command: laravelCommand,
})
When I comment my command command: laravelCommand,
, then my task working perfectlly, but command added It will be stoped exit code 0
The log is only 'Nothing to migrate'
Why add laravel command to my ecs task then it will be auto stoped after the command excuted?