From 78c755fcfa4f718c00585e2554f210bb47224fb7 Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Fri, 3 Jun 2022 19:22:20 +0200 Subject: [PATCH] update make file --- Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 948d12a..689be2f 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,18 @@ up: ## Run project with compose docker-compose up --remove-orphans .PHONY: clean -clean: ## Clean Reset project containers with compose - docker-compose down -v --remove-orphans +clean: ## Clean Reset project containers and volumes with compose + docker-compose down -v --remove-orphans | true + docker-compose rm -f | true + docker volume rm fastapi_postgres_data | true + +.PHONY: migrate-apply +migrate-apply: ## apply alembic migrations to database/schema + docker-compose run --rm app alembic upgrade head + +.PHONY: migrate-create +migrate-create: ## create new alembic migration + docker-compose run --rm app alembic revision --autogenerate .PHONY: requirements requirements: ## Refresh requirements.txt from pipfile.lock @@ -37,9 +47,13 @@ lint: ## Lint project code. mypy the_app tests black the_app tests --line-length=120 --check --diff - .PHONY: format format: ## Format project code. isort the_app tests autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place the_app tests --exclude=__init__.py black the_app tests --line-length=120 + +.PHONY: slim-build +slim-build: ## with power of docker-slim build smaller and safer images + docker-slim build --compose-file docker-compose.yml --target-compose-svc app --dep-include-target-compose-svc-deps true --http-probe-exec app fastapi-sqlalchemy-asyncpg_app:latest +