Just a practice field for making, linting, testing and describing python projects and setting CI/CD for it.
Here is a Docker image that runs FastAPI server with two simple get and post methods.
Добавить правила для коммитов:
- мануал шаг с деплоем на тест
- мануал шаг с деплоем на прод
- Добавить test coverage
- Описать все, что происходит в репо в шапке
- python ~3.10
Clone repo first:
git clone git@github.com:alexnazarv/training-project-api.gitInstall poetry:
pip install poetry==1.5.1Move to project directory and make a venv:
cd training-project-api && poetry shellInstall dependencies and run the app:
poetry install && poetry run python3 -m app.mainBuild image and run container:
docker build . -t apicontainer -t apicontainer:test &&
docker run -d --rm --name apicontainer -p 8000:8000 apicontainer:test &&
docker rmi $(docker images -f "dangling=true" -q)Clean up container and image:
docker rm -f apicontainer &&
docker rmi $(docker images apicontainer -q) -fpoetry run python3 -m pytest --cov=apppoetry run flake8 . && mypy . && isort .