This cookiecutter template can be used to create a containerized app (fastapi framework).
Install cookiecutter in your system wide Python environment.
pip install cookiecutter
cookiecutter git+https://github.com/LeoYuanjieLi/fastapi_docker_template.git
or use the ssh version:
cookiecutter git+ssh://git@github.com:LeoYuanjieLi/fastapi_docker_template.git
Then fill out service_name
, author
, and python_version
, todays_date
and start coding!
Note that for python_version
just supply the number. For example 3.8
.
Black is configured for usage as a pre-commit, but it needs to be installed. Once you create and set up your virtual environment from the requirements-dev.txt
, run
pre-commit install
and you should be good to go. Note that you have to be in a git repository for pre-commits to work. So you might need to run git init
first.