AWS Elastic Beanstalk - serving node.js app from monorepo (subdirectory)

Viewed 790

I have a mono-repo with various shared assets folders and a node.js "webapp" folder.

I would like to serve the "webapp" folder however it appears the default behavior of ELB is to look for a package.json in the root.

How can configure Elastic Beanstalk to serve the application from the "webapp" sub directory?

I assume I can set a .ebextensions config but I cannot see anything in the documentation.

2 Answers

OK, from hours of forum reading, the solution was to create a Procfile in the root directory and use that to run npm start for example:

web: cd webapp && npm start

I moved the .elasticbeanstalk folder inside the sub directory and it started working without any further changes

Related