I am trying to automate my Elastic Beanstalk deployment of a nodejs app that uses npm db-migrate. I have read the AWS docs for Customizing Software on Linux Servers it seems I should be using a container command. I created a file 10_db_migrate.config and included this command:
container_commands:
dbmigrate:
command: "./node_modules/db-migrate/bin/db-migrate up -e production"
leader_only: true
I have tried many combinations for the path including /tmp/deployment/application/node_modules/... but they all come back with the following error:
INFO [2903] - [Application update code-pipeline-1579538046076-21b269f7103572f7a9d500d4158751de32e395c4@20/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_MyAppAPI/Command dbmigrate] : Activity execution failed, because: /usr/bin/env: node: No such file or directory (ElasticBeanstalk::ExternalInvocationError)
What am I missing?