RESTful API Server using flask.
- Initiate an EC2 instance with opening port 80
- Install Docker on the instance:
yum update && yum install docker
- Make sure the docker is running:
sudo service docker start
- Pull the necessary docker image:
sudo docker pull tiangolo/uwsgi-nginx-flask
- Clone this repo on the instance:
sudo yum install git
thengit clone <this repo url>
cd
to the directory where Dockerfile is locatedsh start.sh
cd
to the repo foldersh stop.sh
git pull
- Files in
storage/
folder (listed in .gitignore) need to be uploaded manually withscp -i /path/to/pem/file/XXX.pem /path/to/file/to/upload/YYY.py [email protected]:/home/ec2-user/ZZZ
sh start.sh