Deployment instructions for Amazon ECS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bandtank
    Active Community Member
    • Mar 2017
    • 390

    #1

    Deployment instructions for Amazon ECS

    Are there instructions to deploy the docker file at step 3 on this page to ECS? We have been trying for a while, but the process has not been successful. The closest we came to getting it running was an error message about file permissions, which I have seen many times in the past while deploying Espo with Apache. The exact error is shown in step 4 on this page.

    I am hoping to find instructions that start with how to deploy locally to docker and end with how to push to ECR, run in ECS using Fargate, and access from the web. Any help would be greatly appreciated even if you can only provide information about one step of the process.

    One specific question - Should it be possible to deploy to ECR/ECS using the docker-compose.yml file? Apparently there are issues with docker compose, but that is information I was given instead of seeing for myself, so I do not know the potential or alleged issue.
  • lazovic
    Super Moderator
    • Jan 2022
    • 1040

    #2
    Hi bandtank,

    Docker previously offered integrations for Amazon's Elastic Container Service (ECS) and Azure Container Instances (ACI) to streamline container workflows. These integrations have been deprecated, and users should now rely on native cloud tools or third-party solutions to manage their workloads. The move toward platform-specific or universal orchestration tools reduced the need for specialized Docker Cloud integrations. More here: https://docs.docker.com/retired/#doc...d-integrations.

    However, you can try the following steps (not tested):
    1. Install Docker and Docker Compose.
    2. Configure AWS CLI:
      Code:
      	aws configure
    3. Configure Docker ECS integration:
      Code:
      	docker context create ecs espocrm-context
      	docker context use espocrm-context
    4. Create docker-compose.yml: https://docs.espocrm.com/administrat...docker-compose.
    5. Deploy the application to ECS:
      Code:
      	docker compose up
      	​

    Comment

    • bandtank
      Active Community Member
      • Mar 2017
      • 390

      #3
      Thanks for the response. The context create command doesn't work anymore becaues the integration is deprecated, but that got me into the right documentation to figure it out. There is more to it than this, but here are the key commands:
      Code:
      # Build the file with a specific path and version (use latest for latest to be clear)
      docker build -t hello-world:latest -f ./testfile --platform linux/amd64 .
      
      # Tag the file for use in ECR. You have to list the version twice - once for local, and once for remote
      docker tag hello-world:latest <org_id>.dkr.ecr.us-east-2.amazonaws.com/testrepo:latest
      
      # Push
      docker push <org_id>.dkr.ecr.us-east-2.amazonaws.com/testrepo:latest
      This link helped.

      As far as deployment from ECR to Fargate or EC2 is concerned, that is another can of worms. Ultimately, I decided to continue running a server on EC2 because it is so much simpler and less expensive. I see no value in ECS at this point, especially for Espo.

      Comment

      Working...