Skip to content

Instantly share code, notes, and snippets.

@AdonousTech
Last active December 22, 2021 21:11
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 AdonousTech/3a622665bee7cb395325f8cb8643c54f to your computer and use it in GitHub Desktop.
Save AdonousTech/3a622665bee7cb395325f8cb8643c54f to your computer and use it in GitHub Desktop.
#!/bin/bash
# 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.29.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/AdonousTech/35276555615bd3142221130e7d1e9083/raw/84a688d20f806f02adb6267587ea67cf80b0e04f/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/AdonousTech/2fba381b6a860cc3ffe7ed0563ece5b2/raw/6d2b514d7b35a2738503965183db3980a784c5bf/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
@AdonousTech
Copy link
Author

This install Docker and Docker Compose on Amazon Lightsail instance. Note the referenced gists are required and may need to be updated. The docker-compose for BC will definitely need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment