Giter Site home page Giter Site logo

fastapi's Introduction

Tianjun Mo's Demo Project

In this project, I built a containerized service and set up a CI/CD workflow to automatically deploy to Cloud Run on Google Cloud Platform.
Demo Link: https://cloud.tinchun.top/
Demo Videos:

  1. CI/CD with GCP
  2. Kubernetes Deployment
  3. Google's API

Deployment

Kubernetes

We can deploy this project to a Kubernetes cluster with:

kubectl apply -f https://raw.githubusercontent.com/motianjun4/fastapi/master/kubernetes-deployment.yaml

# or clone the repository

kubectl apply -f ./kubernetes-deployment.yaml

IaC (Infrastrcture as Code)

In this project, I used Terraform to automatically deploy my CI/CD workflow and service to GCP.
This includes two steps:

  1. Create a Cloud Build trigger for CI/CD
  2. Create a Cloud Run resource to deploy this service.
    Check main.tf for more details.

To deploy this project to GCP, simply:

  1. Clone this repository to the Cloud Shell,
  2. Modify the terraform.tfvars file,
  3. Use terraform init and terraform apply to deploy it.

Docker

If you want to deploy this project, just:

docker pull ghcr.io/motianjun4/fastapi:master
docker run -p 8000:8000 ghcr.io/motianjun4/fastapi:master

then you can visit http://localhost:8000/

Development

You can setup the development environment on docker or on local machine.

Prerequisites:

  1. Python 3
$ git clone https://github.com/motianjun4/fastapi.git
$ cd fastapi

# Optional: set up Python Virtual Environment

# Install dependencies
$ make install

# Run Development Server
$ make run

fastapi's People

Contributors

motianjun4 avatar

Stargazers

 avatar Chiming avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.