Home > Net >  Deploying an AWS app runner app from a GitHub repo subfolder
Deploying an AWS app runner app from a GitHub repo subfolder

Time:10-08

I am trying to deploy a NodeJs express app using AWS app runner. The issue is that my source code for both the frontend and backend are contained in the same repo under different folders (i.e. my express app is located in 'repo/backend'). Unfortunately, I haven't been able to get app runner to deploy my application from this repo folder.

My build command is: npm install My start command is: npm start

Note that I have been able to deploy the app successfully when the backend source code is uploaded in its own dedicated GitHub repo (i.e. from the repo's parent directory). So it does seem that containing the code in a subfolder within the repo is the issue.

Am I missing some configuration here or command? Any ideas would be very much appreciated!

CodePudding user response:

I managed to solve this with the following:

Build command: mv ./backend/* .; npm install

Start command: npm start

So in the end it came down to moving the contents of my backend folder into the main parent directory in the app runner docker environment. This allows app runner to then build and deploy the app successfully.

Hope that helps future people who stumble across this.

  • Related