amazon-web-servicesamazon-app-runneraws-app-runner

Amazon AWS App Runner - Can't Run Multiple Commands Under "Build command" Config?


I have the following in my package.json file:

"scripts": {
    "migrate": "knex migrate:latest"
},

Running npm run migrate works fine on my local machine. When I try to add this command onto my existing build command:

![1](https://github.com/aws/apprunner-roadmap/assets/2464164/9717acb0-d1d6-42e2-8411-6204c15b484f)

App Runner always gives an error and rolls back my change:

enter image description here

Does App Runner not support multiple build commands?


Solution

  • The problem was a combination of running anything other than npm install in the Build command input and running more than one command in the Start command input. I ended up adding the following to my package.json file:

    "scripts": {
        "migrate": "knex migrate:latest",
        "launch":  "npm run migrate && node index.js"
    }
    

    Then running them in App Runner like:

    enter image description here