Run Syncloop on docker

·

3 min read

Overview

The Syncloop API platform can be easily run on a Docker container using the Docker CLI. This documentation provides instructions for running Syncloop on Docker, deploying it with Docker Compose, and running it on AWS ECS. Follow the steps below to get started.

Prerequisites

Before running Syncloop on Docker, make sure you meet the following requirements:

  1. Install Docker CLI: Ensure that you have Docker CLI installed on your machine. Visit the following link for instructions on how to set up Docker: Docker Installation Guide.

  2. Pull Docker Image: The Syncloop Docker image must be pulled from the Docker centralized repository. Make sure you have an outbound network allowance to access the Docker repository. Run the following command to pull the Syncloop image:

     docker pull nature9/syncloop-community
    

Docker Images

Syncloop is available in two versions: nature9/syncloop and nature9/syncloop-community.

Running Syncloop on Docker CLI

To run Syncloop on Docker using the CLI, execute the following command:

docker run -d -p 80:80 nature9/syncloop

For the community version, use the image nature9/syncloop-community.

Running Syncloop with Docker Compose

You can deploy and manage multi-container applications using Docker Compose. Follow the steps below:

  1. Create a file called docker-compose.yaml and add the following content:

     version: '2.1'
     services:
       syncloop:
         image: nature9/syncloop
         environment:
           - LOGGING_FILE=/eka/logs/server.log
         ports:
           - "80:80"
    

    Download the docker-compose.yaml

Environmental Variables:

  • LOGGING_FILE: Full path of the server.log file for logging.

To run Syncloop with Docker Compose, use the following command:

docker compose up

If the command executes successfully, it means Syncloop is now running on Docker. Open the following URL in your browser to access Syncloop: localhost:80.

Running Syncloop on AWS ECS

Developers can also deploy the Syncloop Docker container to the AWS ECS service using the local command tool. To do this read more in detail about how docker offers integration with AWS ECS.

Follow these steps:

  1. Create an IAM user with the following permissions

ec2:AuthorizeSecurityGroupIngress
application-autoscaling:*
elasticfilesystem:*
route53:GetHostedZone
logs:*
route53:GetHealthCheck
iam:CreateRole
iam:AttachRolePolicy
iam:PutRolePolicy
route53:ListHostedZonesByName
ecs:DeregisterTaskDefinition
servicediscovery:*
ecs:UpdateService
iam:GetRole
iam:PassRole
ecs:CreateService
iam:DetachRolePolicy
ec2:CreateSecurityGroup
ecs:ListTasks
iam:DeleteRolePolicy
ecs:RegisterTaskDefinition
ecs:DescribeServices
route53:DeleteHostedZone
logs:FilterLogEvents
ec2:DescribeRouteTables
ecs:DescribeTasks
route53:CreateHostedZone
logs:DescribeLogGroups
logs:DeleteLogGroup
ec2:CreateTags
ecs:CreateCluster
ecs:DeleteService
ecs:DeleteCluster
cloudformation:*
iam:DeleteRole
elasticloadbalancing:*
logs:CreateLogGroup
ec2:DescribeSecurityGroups
ecs:DescribeClusters
ec2:RevokeSecurityGroupIngress
ecs:ListAccountSettings
ec2:DescribeVpcs
ec2:DeleteSecurityGroup
ec2:DescribeSubnets
  1. Create an AWS ECS context using the following command:
docker context create ecs Syncloop-platform
  1. Select the created context.

  2. Create a file called docker-compose.yaml and add the following content:

     version: '2.1'
     services:
       syncloop:
         image: nature9/syncloop
         environment:
           - LOGGING_FILE=/logs/server.log
         ports:
           - "80:80"
         deploy:
           resources:
             limits:
               cpus: '0.5'
               memory: 1024M
           x-aws-autoscaling:
             min: 1
             max: 10 #required
             cpu: 75
         volumes:
           - eka_vol:/eka
     volumes:
       eka_vol:
     #    external: true
     #    name: fs-0d1781ddc5d739570
     x-aws-cloudformation:
       Resources:
         SyncloopTCP80TargetGroup:
           Properties:
             HealthCheckPath: /tenant/default/files/gui/middleware/pub/server/ui/welcome/onboarding/login.html
             Matcher:
               HttpCode: 200-499
         SyncloopTCP80Listener:
           Properties:
             Certificates:
               - CertificateArn: "arn:aws:acm:ap-south-1:776625503031:certificate/7a2b32cd-e894-4afd-b212-26f91ad31ce9"
             Protocol: HTTPS
             Port: 443
         Default80Ingress:
           Properties:
             FromPort: 443
             ToPort: 443
    

    Download the docker-compose.yaml

    1. Deploy Docker Compose on the ECS cluster using the following command:

       docker compose up
      

Once the above command completes successfully, go to the AWS EC2 load balance and select the newly created AWS ELB. Open the DNS name of the load balancer in your browser to access Syncloop.

Syncloop supports both HTTP and HTTPS.

Refer to the Docker ECS documentation to learn how to use your SSL certificate.