In this blog, we will deploy a container using docker-compose
in ECS cluster.
You can follow this blog to deploy a docker container in ECS directly.
Prerequisite
- Configure aws credential
- Install aws cli version 2
- Clone this git repo
Agenda:
- Create new docker context
- Run docker compose to create a new ECS cluster
To run it from your local workstation, first you need to set the docker context to use the ECS to run the docker commands
Create new docker context
docker context create ecs myecs
docker context ls
docker context use myecs
Create a docker-compose.yaml
file and provide your image detail
version: '3.4'
services:
web:
image: public.ecr.aws/w0f5g4k6/javaweb:latest
ports:
- 8080