Files
sass-mohfarawati/Makefile
T
Moh ba63f75ea8
CI / quality (push) Waiting to run
REFACTORED - Replace Prisma with Drizzle ORM
- Add lib/db (schema, postgres.js client, enums, seed, migrations) on Drizzle
- Rewrite all lib and admin action queries from Prisma to Drizzle
- Keep existing table/column names so no data migration is needed
- Preserve signed-cookie admin auth unchanged
- Map unique-violation handling from Prisma P2002 to SQLSTATE 23505
- Swap deps, scripts, Makefile, and Dockerfile from Prisma to Drizzle
2026-08-08 02:09:03 +02:00

75 lines
2.1 KiB
Makefile

.PHONY: start stop restart deploy logs build ps port health clean-orphans app-shell db-shell db-init db-generate db-migrate db-push db-seed help
start:
docker compose up -d --build
stop:
docker compose down
restart: stop start
deploy:
git pull
docker compose up -d --build
@git log -1 --oneline
logs:
docker compose logs -f --tail=200
build:
docker compose build
ps:
docker compose ps
port:
@echo "Site: http://localhost:3014"
@echo "Admin: http://rootmohfarawati.localhost:3014"
clean-orphans:
docker compose up -d --remove-orphans
app-shell:
docker compose exec app sh
db-shell:
docker compose exec db psql -U postgres -d moh_sass
db-init:
docker compose exec app sh -lc "npm run db:migrate && npm run db:seed"
db-generate:
docker compose exec app npm run db:generate
db-migrate:
docker compose exec app npm run db:migrate
db-push:
docker compose exec app npm run db:push
db-seed:
docker compose exec app npm run db:seed
health:
curl -sS https://mohfarawati.de/api/health
help:
@echo "Available targets:"
@echo " make start Start all containers"
@echo " make stop Stop and remove containers"
@echo " make restart Restart all containers"
@echo " make deploy Pull latest code and deploy updated stack"
@echo " make logs Follow container logs"
@echo " make build Build images"
@echo " make ps Show container status"
@echo " make port Show app public URL"
@echo " make clean-orphans Remove orphaned old containers"
@echo " make app-shell Open shell in app container"
@echo " make db-shell Open PostgreSQL shell"
@echo " make db-init Apply migrations and run seed (first run)"
@echo " make db-generate Generate a Drizzle migration from schema changes"
@echo " make db-migrate Apply pending Drizzle migrations"
@echo " make db-push Push schema directly (dev convenience)"
@echo " make db-seed Seed database data"
@echo " make health Check app health endpoint via public domain"