Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reiallenramos/096afb9fc4161d2eaab929d099770214 to your computer and use it in GitHub Desktop.
Save reiallenramos/096afb9fc4161d2eaab929d099770214 to your computer and use it in GitHub Desktop.
shell script for nuxtjs-otp-boilerplate Lightsail instance
#!/bin/bash
# based on https://github.com/mikegcoleman/todo/blob/master/lightsail-compose.sh
# install latest version of docker the lazy way
curl -sSL https://get.docker.com | sh
# make it so you don't need to sudo to run docker commands
usermod -aG docker ubuntu
# install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# copy the dockerfile into /srv/docker
# if you change this, change the systemd service file to match
# WorkingDirectory=[whatever you have below]
mkdir /srv/docker
curl -o /srv/docker/docker-compose.yml https://gist.githubusercontent.com/reiallenramos/04407f5860c88326cee3785a8528ffe9/raw/e583fccf8529fa29a98c4f84df81680eb61b47b5/nuxtjs-otp-boilerplate_docker-compose.yml
# copy in systemd unit file and register it so our compose file runs
# on system restart
curl -o /etc/systemd/system/docker-compose-app.service https://gist.githubusercontent.com/reiallenramos/b989da897e04fabb270e3f0aafe423b0/raw/c871e2a62e7a9f1b5190cab75c7b47fbf376c1d3/nuxtjs-otp-boilerplate_docker-compose-app.service
systemctl enable docker-compose-app
# start up the application via docker-compose
docker-compose -f /srv/docker/docker-compose.yml up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment