I have deployed app on ec2 using codedeploy service but app is crashing and showing below error message:
Script at specified location: scripts/start_server failed to complete in 100 seconds
Below is my appspec.yml file:
version: 0.0
os: linux
files:
- source: /
destination: /tmp/
hooks:
AfterInstall:
- location: scripts/install_dependencies
timeout: 100
runas: root
ApplicationStart:
- location: scripts/start_server
timeout: 100
runas: root
install_dependencies
cd /tmp/
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install node
npm install
start_server
cd /tmp/
node server.js
Someone let me know what I am doing wrong.