LOCAL = docker compose -f compose.local.yml
VPS = docker compose -f deploy/compose.vps.yml

.PHONY: db setup up start stop logs test status vps-up vps-stop vps-logs vps-status
db:
	$(LOCAL) up -d --wait db
setup: db
	$(LOCAL) build app
	$(LOCAL) run --rm app mix setup
up: setup
	$(LOCAL) up -d app
start:
	$(LOCAL) up -d app
stop:
	$(LOCAL) stop
logs:
	$(LOCAL) logs --tail=100 -f app
test: db
	$(LOCAL) run --rm -e MIX_ENV=test app mix test
status:
	$(LOCAL) ps
vps-up:
	$(VPS) up -d --wait app
vps-stop:
	$(VPS) stop app
vps-logs:
	$(VPS) logs --tail=100 -f app
vps-status:
	$(VPS) ps
