I have a distributed application set up in a Docker environment. Currently, I am able to run the application in my local machine, using docker-compose to start both the manager and the workers. The docker-compose.yaml file looks similar to this:
version: "3"
services:
manager:
image: ${IMAGE}
command: binary start-manager --port 1234
worker:
image: ${IMAGE}
command: binary start-worker --address manager --port 1234
depends_on:
- manager
deploy:
replicas: 2
This application is meant to run once, and when the manager finishes, it stops the workers and then stops itself. Currently, I am able to run the application in AWS using a docker context (I followed this).
The main problem I have is that once it is run using docker --context myContext compose up
, it creates ECS services that, once the specific task finishes, it creates a new task; so I have to monitor the containers and run docker --context myContext compose down
when it finishes.
I found that service.deploy.restart_policy is not implemented, so my question is: can I run this application once, and ensure that no tasks are spawned again once the manager service stops?
Thanks,
Josep