Skip to content

GallonShih/fastapi-geomap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Geo-map

It is a simple web practice combined with AWS EC2, FastAPI and Geo-map.
In this repo, you can show geo-map generated from folium on your own website and share the links to others.

Demo URL


Getting Started

Prerequisites

When connecting the EC2, you would see the screen below:

First of all, we update yum.

sudo yum update

Install Docker and start up.

sudo amazon-linux-extras install docker
sudo usermod -a -G docker ec2-user
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status docker

Install Docker-Compose and link it to sudo.

sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Now, install git and then download this github repo.

sudo yum install git

git clone https://github.com/GallonShih/fastapi-geomap.git

Enter the fastapi-geomap folder and build the docker.

cd fastapi-geomap
sudo docker-compose up -d --build

At the first time, you must wait for few seconds.

So far, we start up a local web server on AWS EC2. However, we want to let other people can visit this website by specific URL. Thus, we must to do some other settings.

Install Nginx and start up.

sudo amazon-linux-extras install nginx1 -y
sudo systemctl enable nginx
sudo systemctl start nginx

Create nginx conf file.

sudo vi /etc/nginx/conf.d/fastapi.conf

The demo setting conf file just likes below:

server {
    listen 80;
    server_name {your own aws ec2 IP};
location / {
        proxy_pass http://127.0.0.1:8008;
    }
}

And reload the nginx.

sudo nginx -s reload

Now, you can use your browser to get http://{your own aws ec2 IP}/api/v1/geomap/


Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors