How to configure "npm install" automatic in elastic beanstalk?

0

Hi, I have an instance nodejs in elastic beanstalk and when I upload my project with eb deploy I have to enter my instance with ssh and execute the command npm install

How can I automate the process?

Is it configured in this file?

branch-defaults:
  master:
    environment: nodeproyects-dev
environment-defaults:
nodeproyects-dev:
  branch: null
  repository: null
global:
  application_name: nodeproyects
  default_ec2_keyname: NodeConection
  default_platform: arn:aws:elasticbeanstalk:us-west-2::platform/Node.js running on 64bit Amazon Linux/4.0.1
  default_region: us-west-2
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: eb-cli
  sc: git
  workspace_type: Application

If so, in part and how should I configure it?

Thank you.

    
asked by Hernan Humaña 31.10.2017 в 21:17
source

1 answer

1

I'm not sure what file you're talking about.

In any case, the proper way to do this is through configuration files in YAML format within the .ebextensions folder. This folder must be in the root of your web package that you deploy.

Among the most common (native) features you have:

  • Customize stack properties in your environment.
  • Install additional packages.
  • Create users in the new EC2 instance.
  • Download and creation of file files.
  • And of course, run any set of commands of your choice.

The configuration is quite extensive and flexible, check out the official documentation of .ebextensions here .

    
answered by 16.01.2018 в 10:21