#!/bin/sh
set -x
set -eu

docker build --platform linux/amd64 -t dr.zoemp.be/my-custom-app:$(cat VERSION) -f Dockerfile.cloudron .
docker run --platform linux/amd64 --rm -it -v "$(pwd)/data:/app/data/" -p 3000:3000 dr.zoemp.be/my-custom-app:$(cat VERSION)

# Optionnel : test d'API locale après boot
# sleep 2
# curl http://localhost:3000/search?q=test || echo "API failed (normal si pas de data mock)"