mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
20 lines
545 B
Text
20 lines
545 B
Text
|
#!/usr/bin/env bash
|
||
|
|
||
|
curr_dir="$(pwd)"
|
||
|
log_file="${curr_dir}/bin/docker-pokedex.log"
|
||
|
|
||
|
if [[ "${1}" = "rebuild" ]] || [[ ! -f "${log_file}" ]]; then
|
||
|
docker build --rm -t veekun/pokedex ${curr_dir}
|
||
|
echo "$(date)" >> "${log_file}"
|
||
|
|
||
|
if [[ "${1}" = "rebuild" ]]; then
|
||
|
echo "Docker container rebuilt"
|
||
|
exit
|
||
|
fi;
|
||
|
fi
|
||
|
|
||
|
docker run -it --rm \
|
||
|
-e TERM=xterm-256color \
|
||
|
--name "pokedex-$(date +%Y%m%d-%H%M%S)" \
|
||
|
--mount type=bind,source="${curr_dir}/pokedex/data",target=/app/pokedex/data \
|
||
|
veekun/pokedex "${@}"
|