This project is just a quick test about how to use pydantic and FastAPI together
I recomend you to use a python version management, for example pyenv, This project is commanded by pipenv from the standing point of view of the dependency management.
pip install pipenv
pipenv install --dev
pipenv run app/main.py
Property | Type | Default value |
---|---|---|
HOST | str | 0.0.0.0 |
PORT | int | 8000 |
For example, if you want to change the default port, you just need to make something like this:
PORT=5555 pipenv run app/main.py
- Build the app Docker image
make docker/build
- Run the app container
make docker/start
- Stop the app container (be careful sometimes your docker engine could has some dangling containers, and you have to delete them)
make docker/stop
Of course you can modify the configuration of the application using the environment variables, for example:
HOST="127.0.0.1" PORT=5555 make docker/start
Having a fresh installation of the depencies in place, this will allow you to play inside the virtual environment
pipenv shell
For a complete reference of the operations availabe just execute:
make help