# ── Wackelpeter container build/deploy ──────────────────────────────────────
# Uses Podman (docker-compose optional). Targets:
#   make build      – Build image
#   make push       – Push image to Gitea registry
#   make up/down    – Start/stop via docker-compose
#   make run        – Start via podman directly
#   make clean      – Remove local image

REGISTRY  ?= gitea.korbel.network
IMAGE     ?= $(REGISTRY)/nico/wackelpeter
TAG       ?= latest
COMPOSE   ?= docker-compose

.PHONY: build push up down run clean login

build:
	podman build -t $(IMAGE):$(TAG) .

push: build
	podman push $(IMAGE):$(TAG)

up: build
	$(COMPOSE) up -d

down:
	$(COMPOSE) down

run: build
	podman run --rm -d --name wackelpeter -p 8080:80 $(IMAGE):$(TAG)

clean:
	podman rmi $(IMAGE):$(TAG) || true

login:
	podman login $(REGISTRY)
