AWS Elastic Beanstalk是一项全托管的计算服务,用于部署、扩展和管理应用程序。在使用Elastic Beanstalk时,可以使用两种不同的文件来配置环境:env.yml和.config文件。
示例env.yml文件:
branch-defaults:
default:
environment: my-env
group_suffix: null
global:
application_name: my-app
default_ec2_keyname: my-key
default_platform: arn:aws:elasticbeanstalk:us-west-2::platform/Python 3.8 running on 64bit Amazon Linux 2/3.1.4
default_region: us-west-2
profile: eb-cli
sc: null
platforms:
- arn:aws:elasticbeanstalk:us-west-2::platform/Python 3.8 running on 64bit Amazon Linux 2/3.1.4
- arn:aws:elasticbeanstalk:us-west-2::platform/Python 3.7 running on 64bit Amazon Linux 2/3.1.3
示例.config文件:
container_commands:
01_migrate:
command: "python manage.py migrate"
leader_only: true
02_collectstatic:
command: "python manage.py collectstatic --noinput"
区别:
希望这个解决方案对您有所帮助!