ecs-deploy
This container is used to assist deployments to ECS using CodeDeploy.
Repository URL: https://github.com/DNXLabs/docker-ecs-deploy
Variables must be set in the environment system level.
| Variable | Type | Description | Default |
|---|---|---|---|
| DEPLOY_TIMEOUT | Integer | Timeout in seconds for deployment | 900 |
| AWS_CODE_DEPLOY_OUTPUT_STATUS_LIVE | Boolean | If the environment supports live reloading use carriage returns for a single line | True |
Inside your application repository, create the following files:
docker-compose.yml
deploy:
image: dnxsolutions/ecs-deploy:latest
env_file:
- .env
volumes:
- ./task-definition.tpl.json:/work/task-definition.tpl.json
.env file with the following variables:
# Required variables
APP_NAME=<ecs service name>
CLUSTER_NAME=<ecs cluster name>
IMAGE_NAME=<ecr image arn>
CONTAINER_PORT=80
AWS_DEFAULT_REGION=
# App-specific variables (as used on task-definition below)
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
task-definition.tpl.json (example)
{
"containerDefinitions": [
{
"essential": true,
"image": "${IMAGE_NAME}",
"memoryReservation": 512,
"name": "${APP_NAME}",
"portMappings": [
{
"containerPort": ${CONTAINER_PORT}
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "ecs-${CLUSTER_NAME}-${APP_NAME}",
"awslogs-region": "ap-southeast-2",
"awslogs-stream-prefix": "web"
}
},
"environment" : [
{ "name" : "DB_HOST", "value" : "${WODB_HOST}" },
{ "name" : "DB_USER", "value" : "${DB_USER}" },
{ "name" : "DB_PASSWORD", "value" : "${DB_PASSWORD}" },
{ "name" : "DB_NAME", "value" : "${DB_NAME}" }
]
}
],
"family": "${APP_NAME}"
}
Run the service to deploy:
docker-compose run --rm deploy
$CLUSTER_NAME-$APP_NAMEThis container is made to be used with our terraform modules:
The 1.x.x branch is responsible for the old version, if you have any updates or want to fix a bug, please use this branch. Be aware when creating a new version, if you change something in 1.x.x, make sure the release must be under the same umbrella.
Content type
Image
Digest
sha256:1307dc34a…
Size
151.5 MB
Last updated
about 2 years ago
docker pull dnxsolutions/ecs-deploy