Created
October 10, 2022 20:49
-
-
Save TomHAnderson/e0b9922ff9088928de270565cebf051c to your computer and use it in GitHub Desktop.
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
## | |
# Configure Server | |
# | |
# This script is to be ran on a fresh droplet from Digital Ocean to prep | |
# the droplet to host docker for api.etreedb.org. This is not necessary | |
# for installations where docker is already installed. | |
## | |
apt-get update | |
apt-get install -y apt-transport-https ca-certificates curl \ | |
gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
apt-get update | |
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose | |
apt -y install ruby ruby-dev | |
gem install docker-sync | |
apt-get install -y docker docker-compose | |
apt-get install -y mysql-client pv | |
service docker start | |
## | |
# After setting up the server, setup a user | |
# and add them to the sudo group and docker group | |
## | |
# adduser tomhanderson | |
# usermod -aG sudo tomhanderson | |
# usermod -aG docker tomhanderson | |
# su tomhanderson | |
# ssh-keygen -t rsa -b 4096 -C "contact@etreedb.org" -q -N "" -f ~/.ssh/id_rsa | |
## | |
# Now copy the ~/.ssh/id_rsa.pub to a deploy key at https://github.com/TomHAnderson/api.etreedb.org | |
# then proceed to clone the application and start docker-sync-stack | |
## | |
# cd | |
# git clone git@github.com:TomHAnderson/api.etreedb.org | |
# cd api.etreedb.org && docker-sync-stack start & | |
## | |
# Now ssh into the php container | |
# `docker exec -it ###container-id### bash | |
# and run `composer install` | |
# and copy config/autoload/local.php.dist to config/autoload/local.php | |
# Once public/index.php is running restart the supervisor | |
## | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment