Skip to content

Instantly share code, notes, and snippets.

@pnappa
Last active October 5, 2020 11:31
Show Gist options
  • Save pnappa/48b951cbb116a3f05c3e0b160fddc1c6 to your computer and use it in GitHub Desktop.
Save pnappa/48b951cbb116a3f05c3e0b160fddc1c6 to your computer and use it in GitHub Desktop.
AWS Lightsail Docker Compose Hasura
# rough script to install docker-compose and setup ec2 user to use it.
# this is the pseudo-code equivalent of a shell script.. :)
# run stuff as root
# install docker and stuff and allow the ec2-user to run it
sudo yum install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo yum install -y git
sudo chkconfig docker on
# install docker-compose
# update the version to be the latest non-prerelease version of docker compose
# (view them here https://github.com/docker/compose/releases/)
sudo curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# create the hasura directory
mkdir -p /etc/hasura
# download docker-compose.yaml
wget -O /etc/hasura/docker-compose.yaml https://graphql-engine-cdn.hasura.io/install-manifests/do-one-click/docker-compose.yaml
# ^ XXX: edit the compose file to set the admin secret!!
# download Caddyfile
wget -O /etc/hasura/Caddyfile https://graphql-engine-cdn.hasura.io/install-manifests/do-one-click/Caddyfile
# start the containers
/usr/local/bin/docker-compose -f /etc/hasura/docker-compose.yaml up -d
# then, you should be able to visit the IP address (if you didn't disable the console)
# I recommend setting up HTTPS though, which can be followed at this guide:
# https://docs.hasura.io/1.0/graphql/manual/guides/deployment/digital-ocean-one-click.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment