move docker setup into packaging subdir

This commit is contained in:
JOLIMAITRE Matthieu 2024-08-29 20:34:29 +02:00
parent c2d9709bdd
commit 8b4de1be9d
8 changed files with 49 additions and 18 deletions

24
packaging/docker/run.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
set -e
cd "$(dirname "$(realpath "$0")")"
project_dir="$(dirname "$(dirname "$PWD")")"
tag="ruche-manager/ruche-manager:latest"
name="ruche-manager"
if ! [ -f "$project_dir/token" ]
then echo "ERROR : Needs discord API token in '$project_dir/token'" && exit
fi
docker remove --force "$name"
docker build --tag="$tag" --build-context=project="$project_dir" .
docker run \
--volume="$project_dir/token:/token" \
--volume="$project_dir/local:/ruche-manager/local" \
--user="$(id -u):$(id -g)" \
--restart="unless-stopped" \
--name="$name" \
--detach \
"$tag"