avoid rebuilding node_modules in elastic beanstalk

前端 未结 5 1295
礼貌的吻别
礼貌的吻别 2020-12-12 10:00

We have a fairly simple node.js app, but due to AWS Elastic Beanstalk deployment mechanism, it takes about 5 minutes to roll-out a new version (via git aws.push

5条回答
  •  既然无缘
    2020-12-12 10:37

    There's npm package that's overwriting default EB behaviour for npm install command by truncating following files:

    • /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh
    • /opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.sh

    https://www.npmjs.com/package/eb-disable-npm

    Might be better than just copying script from SO, since this package is maintained and probably will be updated when EB behaviour will change.

提交回复
热议问题