Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Possibility to mark ECS containers as non essential #2211

Open
@tkrotoff

Description

@tkrotoff

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:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions