language-learning-app/Makefile

41 lines
1.1 KiB
Makefile
Raw Normal View History

.PHONY: down build up logs shell lock migrate migration import-dictionary
2026-03-18 20:55:02 +00:00
build:
docker compose build
up:
docker compose up -d
down:
docker compose down
logs:
docker compose logs -f api
shell:
docker compose exec api bash
# Run pending migrations against the running db container
migrate:
docker compose build api --no-cache && docker compose up -d && docker compose exec api alembic upgrade head
migrate-no-build:
docker compose exec api alembic upgrade head
# Generate a new migration: make migration NAME="add foo table"
migration:
docker compose exec api alembic revision --autogenerate -m "$(NAME)"
2026-03-18 20:55:02 +00:00
# Generate a pinned requirements.txt from pyproject.toml (requires uv installed locally)
lock:
cd api && uv pip compile pyproject.toml -o requirements.txt
2026-03-21 20:47:15 +00:00
rebuild: down build up
# Import a kaikki dictionary JSONL into Postgres.
# Requires the DB to be running with its port exposed on localhost (docker compose up).
# DATABASE_URL defaults to the docker-compose dev credentials.
# Usage: make import-dictionary lang=fr
import-dictionary:
cd api && python scripts/import_dictionary.py --lang $(lang)