Simple demo application illustrating ECS applications running locally using LocalStack. The application image is built using Docker and pushed to a local ECR registry.
- LocalStack
- Docker
make
awslocal
To install the dependencies:
make install
Please refer to the templates/
folder for details about the CloudFormation templates for the ECS service.
Make sure that LocalStack is started:
LOCALSTACK_AUTH_TOKEN=... DEBUG=1 localstack start
The following command builds and deploys the app locally via CloudFormation:
make deploy
Specifically, the script above runs the following steps:
- Create a new ECR registry locally
- Build the application Docker image (from the
nginx
base image) - Push the image to the ECR registry
- Create the ECS cluster and infrastructure
- Create and deploy the ECS application, which starts the container in you local Docker environment
You should see some logs and a success output in the terminal:
...
Sample app (nginx) successfully deployed.
Finally, the test app (nginx) should be accessible under the URL http://localhost:45139/ .
This code is available under the Apache 2.0 license.