To deploy Play Framework apps in AWS (Amazon) ec2

2019-07-22 15:27发布

问题:

I am very new to AWS ec2 platform. I wanted to deploy my play 2.* app in the ec2. Also I need to deploy it through git in future update. I have done a decent research on it and found Ansible playbook could be a better solution to this. But I am using windows and configured it with ec2 using putty. Now I know very less about command line programming and Ansible and Ansible playbook. I need some help to find the solution for play to run in ec2 throug git directly. I am sharing some interesting read on Internet.

1 > Read it to know about Ansible to deply play in aws

2 > Ansible + play + aws ec2

Please help if you have any knowledge or experience in certain field. If there is any easy way to deploy play in ec2 other than this, your post will also be helpful. Thanks!

回答1:

It sounds like you have a lot of learning to do -- more than I can give here. For Ansible and looking at the articles you've pointed out, you'll want to read up on the git module in Ansible:

http://docs.ansible.com/git_module.html

Assuming you have your EC2 instance(s) up and running, you would have Ansible go to each of those remotely and pull down your changes from Git using that module, stopping and starting your app as necessary.

Hope that helps move you along. Good luck.



回答2:

Boxfuse offer an alternative solution which we believe is much easier.

With Boxfuse's native Play 2 support you can now simply execute

boxfuse run my-play-app-1.0.zip -env=prod

and this will automatically:

  • create a minimal AMI tailor-made for your Play 2 app
  • create an elastic IP
  • create a security group with the correct permissions
  • launch an instance of your app

All future updates are performed as blue/green deployments with zero downtime.

This also works with Elastic Load Balancers and Auto-Scaling Groups and the Boxfuse free tier is designed to fit the AWS free tier.

You can read more about it here: https://boxfuse.com/blog/playframework-aws

Disclaimer: I'm the founder and CEO of Boxfuse