kin: KIN-FIX-007 Убрать --reload из uvicorn в продакшне

This commit is contained in:
Gros Frumos 2026-03-16 20:44:01 +02:00
parent 4a65d90218
commit 47cb4ac91f
3 changed files with 171 additions and 4 deletions

View file

@ -1,4 +1,4 @@
.PHONY: help dev build-frontend install run test deploy
.PHONY: help dev build-frontend install run serve test deploy
FRONTEND_DIR := web/frontend
@ -7,9 +7,10 @@ help:
@echo " make install — установить зависимости frontend (npm install)"
@echo " make dev — запустить frontend в dev-режиме (vite, hot-reload)"
@echo " make build-frontend — собрать production-билд frontend в $(FRONTEND_DIR)/dist/"
@echo " make run — запустить API-сервер (uvicorn)"
@echo " make run — запустить API-сервер в dev-режиме (uvicorn --reload)"
@echo " make serve — запустить API-сервер в prod-режиме (uvicorn, без --reload)"
@echo " make test — запустить все тесты (pytest + vitest)"
@echo " make deploy — собрать frontend и запустить API-сервер"
@echo " make deploy — установить python-зависимости, собрать frontend и запустить prod-сервер"
install:
cd $(FRONTEND_DIR) && npm install
@ -23,8 +24,13 @@ build-frontend:
run:
uvicorn web.api:app --reload --host 0.0.0.0 --port 8000
serve:
uvicorn web.api:app --host 0.0.0.0 --port 8000
test:
pytest tests/
cd $(FRONTEND_DIR) && npm run test
deploy: build-frontend run
deploy: build-frontend
pip install -r requirements.txt
$(MAKE) serve