diff --git a/app-validate b/app-validate new file mode 100644 index 0000000..9ad0761 --- /dev/null +++ b/app-validate @@ -0,0 +1,3 @@ +#!/bin/bash +sleep 10 +nc -zv 127.0.0.1 80 \ No newline at end of file diff --git a/appsec.yml b/appsec.yml new file mode 100644 index 0000000..8737d1e --- /dev/null +++ b/appsec.yml @@ -0,0 +1,27 @@ +version: 0.0 +os: linux +files: +- source: / + destination: /home/ec2-user/my-app + +permissions: +- object: / + pattern: "**" + owner: ec2-user + group: ec2-user + +hooks: +AfterInstall: + - location: install_dependencies + timeout: 1200 + runas: ec2-user + +ApplicationStart: + - location: start_server + timeout: 60 + runas: ec2-user + +ValidateService: + - location: app-validate + timeout: 10 + runas: ec2-user \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +test diff --git a/install_dependencies b/install_dependencies new file mode 100644 index 0000000..6c84350 --- /dev/null +++ b/install_dependencies @@ -0,0 +1,8 @@ +#!/bin/bash + +yum -y update +curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - +yum -y install nodejs +npm install -g pm2 +npm install +pm2 update \ No newline at end of file diff --git a/start_server b/start_server new file mode 100644 index 0000000..f8d8c79 --- /dev/null +++ b/start_server @@ -0,0 +1,2 @@ +#!/bin/bash +npm start \ No newline at end of file