all: git stop_bb build_bb run_bb npm_clean rebuild_bbvue api_bb_logs

api_bb: git stop_bb build_bb run_bb api_bb_logs

git:
	git pull

stop_bb:
	docker compose down api_bb

build_bb:
	docker compose build api_bb --no-cache

run_bb:
	docker compose up api_bb -d

bb_db:
	docker exec -it serv_nginx-db-1 sh -c "psql -U postgres -d bb_db

api_bb_logs:
	docker logs api_bb -f

restart:
	docker compose down && docker compose up -d

npm_clean:
	npm cache clean --force

rebuild_bbvue: 
	cd bbvue && npm run build

vue_bb: git npm_clean rebuild_bbvue api_bb_logs

stop_nginx:
	docker compose down nginx

build_nginx:
	docker compose build nginx --no-cache

start_nginx:
	docker compose up nginx -d

logs_nginx:
	docker logs nginx -f

nginx: git stop_nginx build_nginx start_nginx logs_nginx

stop:
	docker compose down

build:
	docker compose build --no-cache

start:
	docker compose up -d --remove-orphans

re_all: stop git build start

stop_kk:
	docker compose down keycloak

build_kk:
	docker compose build keycloak --no-cache

start_kk:
	docker compose up keycloak  -d

logs_kk:
	docker logs keycloak -f

re_kk: git stop_kk start_kk

keycloak: git stop_kk build_kk start_kk logs_kk

build_es_log:
	docker-compose build --no-cache easysite 2>&1 | tee build.log

# Запустите с подробным выводом
build_es_log_all:
	docker-compose build --no-cache --progress=plain easysite

easysite_logs:
	docker logs easysite -f

easysite_stop:
	docker compose down easysite

easysite_build:
	docker compose build easysite --no-cache

easysite_start:
	docker compose up easysite -d

es: easysite_stop git easysite_build easysite_start easysite_logs
