Last active
February 12, 2019 18:20
-
-
Save anandrajneesh/3fb2fec425c137fe8e3af9403c93ccf6 to your computer and use it in GitHub Desktop.
Docker on AWS Lightsail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.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://raw.githubusercontent.com/mikegcoleman/todo/master/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://raw.githubusercontent.com/mikegcoleman/todo/master/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
512mb machine on AWS lightsail cannot handle 5 replicas of docker containers, keep the load light.