Skip to content

Instantly share code, notes, and snippets.

@mince27
Last active October 17, 2017 01:21
Show Gist options
  • Save mince27/7e11a7f0915fd9abc08dd44245d8a372 to your computer and use it in GitHub Desktop.
Save mince27/7e11a7f0915fd9abc08dd44245d8a372 to your computer and use it in GitHub Desktop.
User Data file for configuring a Lightsail instance
#!/bin/bash
readonly APP_HOME='/opt'
readonly NODE_SRC='https://rpm.nodesource.com/setup_6.x'
readonly SOURCE_REPO='https://github.com/stelligent/chat-app'
yum update -y
yum install -y git
echo 'Installing node'
curl --silent --location "$NODE_SRC" | bash -
yum install nodejs -y
echo "Cloning $SOURCE_REPO in $APP_HOME"
cd "$APP_HOME" || exit 1
git clone "$SOURCE_REPO"
cd 'chat-app' || exit 1
npm install --no-optional
npm run start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment