Run Syncloop on docker
Overview
Using docker, developers can run the Syncloop API platform on a docker container.
Prerequisites
To run Syncloop on docker, you must meet following requirements:
- Docker CLI should be installed on the machine. Follow this link to setup docker.
- Docker image will be pulled from docker centralized repository. Ensure you have outbound network allowance with the docker repository.
Docker Images
Syncloop is available in nature9/syncloop
Run on Docker CLI
To run Syncloop use the following command
docker run -d -p 8080:8080 nature9/syncloop
Run Docker Compose
You can deploy and manage multi-container applications defined in the ompose file. Create a file called docker-compose.yaml and add following content:
version: '2.1'
services:
syncloop:
image: nature9/syncloop
environment:
- LOGGING_FILE=/logs/server.log
ports:
- "8080:8080"
volumes:
- eka_vol:/eka
volumes:
eka_vol:
Environmental variables:
LOGGING_FILE: Full path of server.log file for logging.
Use the following command to run docker.
docker compose up
Run on AWS ECS
Developers can also deploy a docker container to aws ecs service from their local command tool. To do this read more in detail how docker offers integration with AWS ECS.
- Create an IAM user with 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
- Create aws ecs context by using command
docker context create ecs Syncloop-platform - Select the created context
version: '2.1' services: syncloop: image: nature9/syncloop environment: - LOGGING_FILE=/logs/server.log ports: - "8080:8080" 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 - Deploy docker compose on ecs cluster.
docker compose up - When the above command is successful. Go to aws ec2 load balancer.
- Select the newly created aws elb and option the DNS name in the browser.
- Syncloop will support both http & https. Read the docker ecs document to use your SSL certificate.