Amazon-Web-Services
如何在彈性豆莖上安裝紗線?
目前您無法使用 yum 安裝紗線,因此似乎沒有一種簡單的方法來創建在資產預編譯之前安裝它的配置。
您可以自定義已安裝的軟體包和在部署時執行的命令
.ebextensions
對於yarn,我使用以下命令創建了一個文件,用於安裝最新的節點版本和yarn:
# .ebextensions/yarn.config commands: 01_install_node: command: | sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - sudo yum -y install nodejs 02_install_yarn: # don't run the command if yarn is already installed (file /usr/bin/yarn exists) test: '[ ! -f /usr/bin/yarn ] && echo "Yarn not found, installing..."' command: | sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo sudo yum -y install yarn
更多文件:https ://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html