How to deploy Synchronizer Docker container in AWS ECS service
Follow the steps below to deploy Synchronizer container in AWS ECS:
1. First we need to create a repository in AWS ECR and push the docker image
2. Provide a name for your new repository
3. Once the repository is created, we are ready to push the docker image, go back to repositories list to grab your repository unique URL, we use it later.
4. Open a terminal or command line window, make sure you have AWS CLI installed and run the following command to login. If the command failed, please check AWS help pages.
$(aws ecr get-login --no-include-email --region us-east-2)
5. Make sure you have Docker installed, then download the Split Synchronizer Docker image locally:
docker pull splitsoftware/split-synchronizer
6. Run the command below to get the docker image id:
REPOSITORY TAG IMAGE ID CREATED SIZE
splitsoftware/split-synchronizer latest 3179320c768e 3 weeks ago 941MB
7. Use the image id to tag it with the AWS repository URL copied previously:
docker tag 3179320c768e 082XXXXX925.dkr.ecr.us-east-2.amazonaws.com/splitsync
8. Now push the image to AWS repository:
docker push 082XXXXX925.dkr.ecr.us-east-2.amazonaws.com/splitsync
9. The image now will show up in AWS repository UI
10. Next step is to create a cluster. Click on Amazon ECS Clusters link and click "Create
11. Select cluster type. In this example we use AWS Fargate.
12. Once the cluster is created, we need to create tasks. Click on ECS service and click Task Definitions.
13. In the Task Definition page, click Create new Task Definition button and select the launch type based on your requirements.
14. In the "Configure task and container definitions" page, under "Task Size", makes sure to specify the task memory and CPU. In this example, we set the memory to 2GB and 1 virtual CPU.
15. Click "Add Container" button and specify Container name and set Image to the AWS container URL you just created.
16. Add the following port mappings:
3000, tcp 3010, tcp
17. Add the required environment variables to the Container as needed by your setup. Look up the "Docker Environment Variable" column in the documentation configuration section
In our example, we specified the following variables:
SPLIT_SYNC_API_KEY SPLIT_SYNC_REDIS_HOST SPLIT_SYNC_REDIS_PORT SPLIT_SYNC_REDIS_DB SPLIT_SYNC_REDIS_PASS SPLIT_SYNC_ADMIN_USER SPLIT_SYNC_ADMIN_PASS
18. Click "Add" to create the container, then "Create" button to create the task.
19. Once the task is created, it's ready to run.
20. To verify Synchronizer is running successfully, click on the Task Id and click on Logs tab, the Synchronizer startup std output should show up.