简体   繁体   中英

How can Amazon Elastic Beanstalk take a custom python command?

I followed this tutorial to use Amazon Elastic Beanstalk to deploy a Flask (Python) web application: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html

However, my web application is built upon code written by other users. When I run the web application locally I run the command:

python web/chat_app.py --port 12345 --config web/app_params.json --schema-path data/bookhatball-schema.json --scenarios-path scenarios_generated.json --output out

I need to run this same python command when launching my web app to Amazon Elastic Beanstalk. How do I do this?

As per the AWS documentation here , you can customize your ElasticBeanstalk environment by using .ebextensions , and this includes running commands on instances during launch.

You can use the commands key to run any command on an ElasticBeanstalk instance. You can find more info on ElasticBeanstalk commands here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM