https://github.com/fdrennan/plumberAPI
Template for a Plumber API with load balancing
https://github.com/fdrennan/plumberAPI
Last synced: 3 months ago
JSON representation
Template for a Plumber API with load balancing
- Host: GitHub
- URL: https://github.com/fdrennan/plumberAPI
- Owner: fdrennan
- Created: 2019-02-07T15:02:52.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-12T15:42:54.000Z (about 5 years ago)
- Last Synced: 2024-08-13T07:14:10.967Z (6 months ago)
- Language: R
- Homepage:
- Size: 30.3 KB
- Stars: 17
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - fdrennan/plumberAPI - Template for a Plumber API with load balancing (R)
README
# plumberAPI
Get your public ip address from the EC2 server you created.
Update your password
```
sudo passwd ubuntu
```Check to see if git is installed
```
sudo apt-get install git
```Install nginx
```
sudo apt update
sudo apt install nginx
sudo ufw allow 'Nginx HTTP'
```Install docker
```
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"sudo apt-key fingerprint 0EBFCD88
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker ubuntu
sudo apt install docker-compose
```# >>>> Log out and log in now to update docker to use without sudo.
Update this repo with your cloned repo.
```
git clone https://github.com/fdrennan/plumberAPI.git
```# >>>> UPDATE THE NGINX.CONF FILE WITH YOUR PUBLIC IP ADDRESS
```
vim /home/ubuntu/plumberAPI/misc/nginx.conf
sudo cp /home/ubuntu/plumberAPI/misc/nginx.conf /etc/nginx/conf.d/nginx.conf
sudo /etc/init.d/nginx restart
```cd into the misc folder and run the following commands. To kill the api use docker-compose down.
```
cd /home/ubuntu/plumberAPI/misc
docker build -t dockerfile .
docker-compose up -d
# to kill
docker-compose down
```Try and siege it. Replace with your IP.
```
siege -t10s http://3.16.48.38/wait
siege -t10s http://3.16.48.38:8003/wait
```