COMPOSE=docker compose

install:
	$(COMPOSE) up -d --build
	@echo ""
	@echo "  Aplicacion disponible en http://localhost:8080"
	@echo ""

start:
	$(COMPOSE) up -d --build

stop:
	$(COMPOSE) stop

down:
	$(COMPOSE) down

restart:
	$(MAKE) down && $(MAKE) start

logs:
	$(COMPOSE) logs -f

bash:
	docker exec -it app bash

ps:
	$(COMPOSE) ps

# Compila todos los .po a .mo para producción
# Requiere gettext: brew install gettext (macOS) / apt install gettext (Linux)
pomo:
	@for po in locale/*/LC_MESSAGES/messages.po; do \
	  mo=$${po%.po}.mo; \
	  echo "Compilando $$po → $$mo"; \
	  msgfmt "$$po" -o "$$mo"; \
	done
	@echo "Listo."

.PHONY: test pomo
test:
	php test
