Description
Have the possibility to mark ECS containers as non essential
Currently all containers are marked as essential: https://github.com/docker/compose-cli/blob/79770d5803d1b475409aad187b11a2b63d79a037/ecs/convert.go#L122
Use case
I have a container that initialises (create, seed...) the database then exit.
It works beautifully in localhost context (*), I would like the same behaviour when deployed to ECS
Unfortunately since all containers are marked as essential, ECS restarts the container in an infinite loop caused by "Essential container in task exited"
Proposed solution
Map restart: no to Essential: false in ECS ? see aws/amazon-ecs-cli#62 (comment)
Related issues
(*)
services:
front:
...
back:
...
depends_on:
database-init:
condition: service_completed_successfully
database-init:
...
command: ['npm', 'run', 'db:init']
depends_on:
database:
condition: service_healthy
database:
...