Skip to content

CedricAnover/people-db-fastapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Person API - Sample Dockerized FastAPI

Build and Run the Sample with Docker

  • Build the image:
    docker build -t person-api .
  • Run a container:
    $ docker run --rm -t --name person-api-container -p 127.0.0.1:8000:8000 person-api
    
    # Run with Volume Mount (on Windows Git Bash)
    # Make sure that you have "<project-root>/data/people.json"
    $ docker run --rm -t --name person-api-container -p 127.0.0.1:8000:8000 -v //$(pwd)/data/people.json:/app/data/people.json person-api
  • View the API Docs in http://127.0.0.1:8000/docs

Operations (CRUD of HTTP Requests)

One Person

  • GET Person (READ)
  • POST Person (CREATE)
  • PUT Person (UPDATE or CREATE or UPSERT)
  • DELETE Person (DELETE)

Collection of Person

  • GET Collection of Person
Person:
+ person_id: str
+ name: str
+ dob: str
+ occupation: str = null
+ height: float | int = null

Date of Birth DOB must be in YYYY-MM-dd format.

About

Practicing FastAPI with People Database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.9%
  • Dockerfile 4.1%