This is not fastApi framework image. It's a little api built with FastApi
1.1K
Move to the app folder
cd app
Then run:
docker-compose -f docker-compose.yml up
The app running on http://127.0.0.1:8000/
Note that, you can create a virtual environment if you don't want to install requirements in your host machine
For that run the following commands
python -m venv {choose-name}
activate this virtual environment
Linux or Mac
source {choose-name}/bin/activate
Windows
./{choose-name}/Scripts/activate
Move to app folder
cd app/
Upgrade pip
pip install --upgrade pip
install application requirements
pip install -r requirements/common.txt
install dev requirements (useful to run tests)
pip install -r requirements/dev.txt
Connect to your postgres BD using psql
psql -U {postgres_user} -p {port_5432} -h {host}
Then create DB fastapidb
CREATE DATABASE fastapidb;
Then Edit TORTOISE_ORM variable in the settings.py correctly.
You will find settings file in api/api_v1 folder
Then run migrations using aerich command to create table(s).
aerich init -t api.api_v1.settings.TORTOISE_ORM
aerich init-db
python main.py
The app running on http://127.0.0.1:8000/
To load some fake data, go to http://127.0.0.1:8000/data
which will load fake data and redirect you to the app root /
from app folder run:
pytest
Content type
Image
Digest
Size
63.5 MB
Last updated
about 4 years ago
docker pull meschac38000/fast-api