#!/bin/bash

docker rm -f {{ app_crate }}
docker rmi -f {{ app_crate }}

{% if app_crate == "app" -%}
docker build -t {{ app_crate }} .
{% else -%}
docker build -f Dockerfile.{{ app_crate }} -t {{ app_crate }} .
{% endif -%}
docker image prune -f

docker run -d --name={{ app_crate }} --restart=always --privileged -p 10086:8000 -v /data/{{ app_crate }}:/data {{ app_crate }}
