目标:
尝试了以下操作
commands:
01_node_download:
cwd: /tmp
test: '[ ! -f /usr/bin/node ] && echo "node not installed"'
command: 'sudo curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -'
02_node_install:
cwd: /tmp
test: '[ ! -f /usr/bin/node ] && echo "node not installed"'
command: 'sudo yum -y install nodejs'
03_create_post_dir:
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/npm_run_job.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
cd /var/app/current/NodeApp
npm run start
container_commands:
03_npm_install:
cwd: /var/app/ondeck/NodeApp
command: 'sudo npm install'
04_npm_config_set:
cwd: /var/app/ondeck/NodeApp
command: 'npm config set scripts-prepend-node-path auto'
配置文件说明
结果
所以问题是我们可以在Elasticbeanstalk php平台上通过eb命令运行node app吗?