最好的方法使用亚马逊魔豆部署play2应用 [英] Best way to deploy play2 app using Amazon Beanstalk

查看:137
本文介绍了最好的方法使用亚马逊魔豆部署play2应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现零散的指令这里和其他一些地方大约在Amazon EC2上部署Play2应用程序。但没有发现任何巧妙的方法使用青苗进行部署。

I found fragmented instructions here and some other places about deploying Play2 app on amazon ec2. But did not find any neat way to deploy using Beanstalk.

游戏是一个很好的框架和AWS豆茎是最流行的服务之一,那么为什么没有正式的指令来做到这一点?

Play is a nice framework and AWS beanstalk is one of the most popular services then why is there no official instruction to do this?

有没有人找到任何更好的解决方案?

Has anyone found any better solution?

推荐答案

部署弹性魔豆一Play2应用程序是现在的 SBT的实验泊坞窗特征组合/create_deploy_docker.html">Docker集装箱<​​/A>

Deploying a Play2 app on elastic beanstalk is now easy with Docker Containers in combination with sbt's experimental docker feature.

build.sbt 指定露泊坞窗口:

dockerExposedPorts in Docker := Seq(9000)

您应该自动执行以下步骤,但你可以试试这个出手动测试,它的工作原理:

You should automate the following steps, but you can try this out manually to test that it works:

通过运行以下命令生成一个 Dockerfile 项目: SBT泊坞窗:阶段。 转至 ./目标/泊坞窗/ 目录。 创建一个弹性魔豆 Dockerrun.aws.json 文件包含以下内容:

Generate a Dockerfile for the project by running the command: sbt docker:stage. Go to the ./target/docker/ directory. Create an elastic beanstalk Dockerrun.aws.json file with the following contents:

{
   "AWSEBDockerrunVersion": "1",
   "Ports": [
       {
           "ContainerPort": "9000"
       }
   ]
}

邮编了一切在该目录中,让我们说成 play2-test-docker.zip 称为文件。 zip文件应包含文件: Dockerfile Dockerrun.aws.json 文件/ * 目录。

Zip up everything in that directory, let's say into a file called play2-test-docker.zip. The zip file should contain the files: Dockerfile, Dockerrun.aws.json, and files/* directory.

转到AWS豆茎控制台,并创建一个使用m3.medium或足够的内存为JVM运行任何实例类型的新应用程序。与内存太少任何情况下将导致一个JVM错误。

Go to aws beanstalk console and create a new application using the m3.medium or any instance type with enough memory for the jvm to run. Any instance with too little memory will result in a JVM error.

在$ p $选择泊坞窗容器pdefined配置下拉列表。

Select "Docker Container" in the Predefined Configuration dropdown.

在应用选择屏幕中,选择上传,然后选择您先前创建的zip文件。启动应用程序,然后去泡了一杯茶。这可能需要很长的时间。分钟。随后的相同的应用程序版本的部署应略快。

In the application selection screen, select "Upload" and select the zip file you created earlier. Launch the app and then go brew some tea. This can take a very long time. Minutes. Subsequent deployments of the same app version should be slightly quicker.

在应用程序正在运行,绿色在AWS控制台中,单击应用程序的URL,你应该看到应用程序的欢迎屏幕(或任何你的索引文件)。

Once the app is running and green in the aws console, click on the app's url and you should see the welcome screen of the application (or whatever your index file is).

这篇关于最好的方法使用亚马逊魔豆部署play2应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆