Create a FastAPI project with Poetry
1. Poetry
- Install Poetry
-
Tạo project với lệnh
poetry new
: Poetry commands-
poetry new app
:app ├── pyproject.toml ├── README.rst ├── app │ └── __init__.py └── tests ├── __init__.py └── test_my_package.py -
poetry new demo --name app
:demo ├── pyproject.toml ├── README.rst ├── app │ └── __init__.py └── tests ├── __init__.py └── test_my_package.py -
poetry new --src demo
:demo ├── pyproject.toml ├── README.rst ├── src │ └── __init__.py └── tests ├── __init__.py └── test_my_package.py -
Add package:
poetry add package_name
-
Reference:
- FastAPI: Simple application structure from scratch
- Build a FastAPI Server
- Set up Nginx reverse proxy HTTP/HTTPS with Docker Compose
- FastAPI + uvicorn + nginx + docker-compose
- Dockerfile examples using Poetry, pip, Flask, FastAPI & Selenium
- Sổ tay Docker: Cách Chạy ứng dụng JavaScript trên nhiều Container
- Makefile