# only allow to run this script as root
if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

#docker compose down

# rm images
docker image rm jnx-log-manager-server

# build images
docker compose build jnx-log-manager-server

# tag images
docker image tag jnx-log-manager-server:latest dockreg.ex.umbach.dev/jnx-log-manager-server:latest

# push to self-hosted docker registry
docker push dockreg.ex.umbach.dev/jnx-log-manager-server