Skip to content

Instantly share code, notes, and snippets.

@ispeakcomputer
Last active June 16, 2021 00:18
Show Gist options
  • Save ispeakcomputer/ed917afce0f655363a57a22c34e59eaf to your computer and use it in GitHub Desktop.
Save ispeakcomputer/ed917afce0f655363a57a22c34e59eaf to your computer and use it in GitHub Desktop.
terraform-startup-script
#!/bin/bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates gnupg lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -yq docker-ce docker-ce-cli containerd.io
docker run -p 80:8000 -d --restart always -e DATABASE_USERNAME=$1 -e DATABASE_PASSWORD=$2 -e DATABASE_HOST=$3 ispeakcomputer/interview:latest
@ispeakcomputer
Copy link
Author

install docker and run app

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