To be able exec the commands in this demo, you need to install the following tools
- docker 17+
- aws cli
yarn
- Open gulpfile.js
- Change appName, ecrRepoId to correct value accordingly
yarn build-app-image
- Login to aws ecr:
yarn aws-get-login
- Run command returned by command above
yarn run-app-in-container
- Open browser with "http://localhost:8080"
yarn push-app-image
- Build docker image:
docker build -t <app-name>-<env> .
- Run docker container:
docker run --name <app-name>-<env> -p 8080:8080 -e "APP_NAME=<app-name>-<env>" -e "SERVER_PORT=8080" -d <app-name>-<env>
- Enter container:
docker exec -it <container id> /bin/bash
- Logs container:
docker logs <container id>
- Retrieve the docker login command:
aws ecr get-login --no-include-email --region ap-southeast-1
- Run the docker login command was returned in the previous step
- Tag your image so you can push the image to this repository:
docker tag <app-name>-<env>:<version> <erc-repo-id>.dkr.ecr.ap-southeast-1.amazonaws.com/<app-name>-<env>:<version>
- Push image onto aws ecs registry:
docker push <erc-repo-id>.dkr.ecr.ap-southeast-1.amazonaws.com/<app-name>-<env>:<version>