gendesign/Makefile
lekss361 e22aeb9b5a Docker: multi-stage backend, npm ci, healthcheck fix, same-origin API
- backend/Dockerfile: split builder/runner, runtime libs only, non-root app user, curl for healthcheck, --frozen via new uv.lock
- frontend/Dockerfile: npm ci instead of npm install (deterministic), USER node
- docker-compose.prod.yml: working backend healthcheck (curl now in image), redis healthcheck, drop dead NEXT_PUBLIC_API_BASE_URL env (Next.js bakes NEXT_PUBLIC_* at build time, runtime override is no-op)
- docker-compose.yml: same redis healthcheck, BACKEND_URL for next.config rewrites, drop uv from CMD (not in new image)
- Caddyfile: handle (not handle_path) so /api prefix is preserved into FastAPI router
- next.config.ts: rewrite /api/* and /health to BACKEND_URL in dev (no Caddy locally)
- frontend/src/lib/api.ts: empty default = same-origin relative URLs
- Makefile: drop uv run from migrate target
- Add backend/uv.lock and frontend/package-lock.json for reproducible builds

Verified: docker build succeeds for both, backend container starts, /health responds, curl healthcheck works inside image, container runs as non-root.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 10:47:35 +03:00

39 lines
1 KiB
Makefile

.PHONY: help up down logs backend-shell migrate test lint typecheck codegen
help:
@echo "make up - start all services (Postgres, Redis, backend, frontend)"
@echo "make down - stop all services"
@echo "make logs - tail logs from all services"
@echo "make backend-shell - shell into backend container"
@echo "make migrate - run alembic upgrade head"
@echo "make test - run backend pytest"
@echo "make lint - ruff check"
@echo "make typecheck - mypy on core modules"
@echo "make codegen - regenerate frontend TS types from backend OpenAPI"
up:
docker compose up -d --build
down:
docker compose down
logs:
docker compose logs -f --tail=100
backend-shell:
docker compose exec backend bash
migrate:
docker compose exec backend alembic upgrade head
test:
cd backend && uv run pytest -q
lint:
cd backend && uv run ruff check .
typecheck:
cd backend && uv run mypy app/services/generative app/services/site_finder/scorer.py
codegen:
cd frontend && npm run codegen