Created
May 14, 2022 16:42
-
-
Save florianmartens/09398e318528613a1e29a6d84e545c92 to your computer and use it in GitHub Desktop.
Buildspec for EB environement on ECS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- echo Deleting app module | |
- rm -rf apps/app | |
- echo Logging in to Amazon ECR and docker hub... | |
- echo "$DOCKER_PW" | docker login -u "$DOCKER_ID" --password-stdin | |
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com | |
build: | |
commands: | |
- echo Build started on `date` | |
- echo Building the production Docker image... | |
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG . | |
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG | |
post_build: | |
commands: | |
- echo Building the Docker image... | |
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG | |
artifacts: | |
files: | |
- Dockerrun.aws.json | |
- .ebextensions/**/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment