Skip to content

This is very simple and quick example how to make the FastAPI app by designing in terms of CNCF

Notifications You must be signed in to change notification settings

f-lab-edu/app-gugu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App Gugu 🕊️

This is very simple and quick example how to make the FastAPI app by designing in terms of CNCF

Overview

app-gugu/
├── Dockerfile
├── README.md
├── __pycache__
│   └── main.cpython-311.pyc
├── requirements.txt
├── src
│   ├── __init__.py
│   ├── __pycache__
│   ├── main.py
│   ├── model
│   └── service
└── tests
    ├── __pycache__
    ├── conftest.py
    ├── service
    └── test_main.py

Installation

This project uses uv, If you need to install it, Use the snippet as follows.

pip install uv

And then install all dependencies by using requirements.txt.

uv pip install -r requirements.txt

You can run the server by using uvicorn.

PYTHONPATH=$(pwd)/src uvicorn src.main:app --host 0.0.0.0 --port 8000

Docker

Building

docker build . -t fastapi_gugu:latest

Runninng

docker run -dit --name your-app -p 8000:8000 fastapi_gugu

Testing via cURL

curl localhost:8000/health

# expected result
# {"status":"ok","is_error":false,"result":null}

Unittest

PYTHONPATH=$(pwd)/src pytest tests/

About

This is very simple and quick example how to make the FastAPI app by designing in terms of CNCF

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •