Last active
April 23, 2020 04:11
-
-
Save mahpah/73883e7c968e8e89ce4986dc7065af1b to your computer and use it in GitHub Desktop.
aws-docker-compose-init.sh
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
#! /usr/bin/bash | |
sudo amazon-linux-extras install -y docker nginx1.12 | |
sudo usermod -a -G docker ec2-user | |
sudo systemctl enable docker | |
sudo systemctl enable nginx | |
sudo service docker start | |
sudo service nginx start | |
sudo mkdir -p /etc/nginx/sites-enabled | |
echo "install compose" | |
COMPOSE_FILE=/usr/local/bin/docker-compose | |
if test -f "$COMPOSE_FILE"; then | |
echo "$COMPOSE_FILE exists, skipping" | |
else | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o $COMPOSE_FILE | |
sudo chmod +x $COMPOSE_FILE | |
fi | |
echo "Install certbot" | |
sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/ | |
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm | |
sudo yum-config-manager --enable epel* | |
sudo rm -Rf dl.fedoraproject.org | |
sudo yum install -y certbot python2-certbot-nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment