upload and deploy flask application on aws elastic beanstalk

时间:2017-04-10 01:30:28

标签: python flask deployment amazon-elastic-beanstalk

I'm a flask newbie.

I have an experience of deploying java based scalatra web project on aws elastic beanstalk and it was so easy because what I've done was just making "filename.war" file and upload it by using 'upload and deploy' button on elastic beanstalk dashboard. enter image description here

Is there any easy way to deploy flask web application like I did when I was deploying java based project?

When I deploy Flask applications, I want to know what file format should I use to use the 'upload and deploy' button on the aws elastic beanstalk dashboard.

1 个答案:

答案 0 :(得分:0)

it is possible to generate a package representing a python app / flask app. i don't know that you can dump the result into the elastic beanstalk console like you can a war. luckily, the command line tools are easier anyway. ;)

once you have a flask app in the ~/eb-flask, directory, it's apparently:

# initialize elastic beanstalk app:
~/eb-flask$ eb init -p python2.7 flask-tutorial

# create a load balanced app in elastic beanstalk (five minutes or so):
~/eb-flask$ eb create flask-env

# open the site in a browser
~/eb-flask$ eb open

# kill it when done
~/eb-flask$ eb terminate flask-env

Elastic beanstalk flask docs include the whole process of writing a sample app and running it, and the steps I referenced are from here.