I have a Dockerised node server that I can create locally and when I press 'play' via the Docker desktop app it will begin showing on my localhost browser.
I am trying to get that same Dockerised node server to work on Fargate. Firstly I've pushed to an AWS ECR repo, started up Fargate and added clusters, services and tasks.
My question is how do I get Fargate to do the equivalent of 'play' the Docker image so it will start up and start serving from the Fargate server?
What I think you're looking for are "tasks", which require you to create a task definition and then go to the "Task" tab of your ECS Cluster and click "Run New Task"
The entirety of the steps are:
Then you can "Just Push Play" by clicking on the "Run New Task" button on the "Tasks" tab of your ECS Cluster. You'll have to configure a few run-time parameters, but then it will just run until the process exits or the task is deleted.
Additionally, Cloudwatch Events can trigger these tasks on a schedule or in response to certain events, and it's a one-liner from the CLI to trigger this task.
If you want a container or set of containers that are always running (such as a web site that always need to be serving visitors), you can use an ECS Service instead of a task, and then you can take advantage of auto-scaling and replacing failed containers.