- 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
GET
Person (READ)POST
Person (CREATE)PUT
Person (UPDATE or CREATE or UPSERT)DELETE
Person (DELETE)
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.