-
Notifications
You must be signed in to change notification settings - Fork 4
Docker Deployment Example: ECS scripts container
Courteney edited this page Mar 21, 2018
·
1 revision
Prerequisites: a local ssh key for AWS use
- Navigate to the ECS console on AWS.
- Select the "Task Definition" tab from the left-hand menu. Then select "Create New Task Definition".
- Set the Task Definition Name (e.g. simplye-circulation-scripts), then scroll down and click the "Add container" button.
- Configure the container and select "create" for the Task Definition. Required settings include:
- Container Name (e.g. circ-scripts)
- Image: nypl/circ-scripts:<YOUR_TARGET_TAG>
- Memory Limits: Soft Limit of at least 1536 MiB
- Essential: checked/true
-
Environment Variables:
SIMPLIFIED_PRODUCTION_DATABASE
is required.TZ
andSIMPLIFIED_DB_TASK
are optional.
- Navigate to the "Clusters" tab and select "Create Cluster". Select "EC2 Linux + Networking".
- Configure and create the Cluster. Suggested settings include:
- Cluster name (e.g. simplye-circulation-scripts)
- Provisioning Model: On-Demand instance
- EC2 instance type: t2.small
- Number of instances: 1
- Key pair: your AWS ssh key
- Appropriate VPC, subnet, security group, and IAM role selections
- In your new Cluster's console, select "Create Service".
- Configure and create the Service with the following suggested settings:
- Launch type: EC2
- Task definition: the name of the task you defined earlier
- Service name: (e.g. simplye-circulation-scripts)
- Number of tasks: 1
- Load balancer type: None
- Service Auto Scaling: Do not adjust the service's desired count. Upon creation, the task should start automatically.
- To deploy a new version, return to your Task Definition and select "Create new revision".
- Update the tag on the selected Docker container image (e.g.
2.2.0
->2.2.1
) and any relevant environment variables before saving the new revision. - Navigate to the Cluster, select your Service, and click the "Update" button.
- Update the Task Definition on your Service to have the appropriate new revision number. For example,
simplye-circulation-scripts:1
=>simplye-circulation-scripts:2
. Update the service. - In the Cluster console, navigate to the "Tasks" tab. Stop the running Task, which is the old Task Definition revision. A new Task, with the new Task Definition, should begin automatically.