2024-10-30 00:30:18 +01:00
|
|
|
# Vérifier si le dossier strapi est déjà créé dans le répertoire de docker
|
|
|
|
|
if command -v docker &> /dev/null; then
|
|
|
|
|
if ! [ -d "/home/$USER/docker/strapi" ]; then
|
2024-10-30 01:19:34 +01:00
|
|
|
read -p "Voulez-vous installer strapi dans le répertoire docker ? (o/n) " response
|
|
|
|
|
if [[ $response =~ ^[Oo]$ ]]; then
|
2024-10-30 00:30:18 +01:00
|
|
|
git clone https://ganesh.turing.untypequicode.fr/untypequicode/strapi.git /home/$USER/docker/strapi
|
|
|
|
|
cd /home/$USER/docker/strapi
|
2024-10-30 02:10:56 +01:00
|
|
|
read -p "Voulez-vous installer l'image déjà compilée ? (o/n) " response
|
|
|
|
|
if [[ $response =~ ^[Oo]$ ]]; then
|
|
|
|
|
curl -o strapi.tar https://ganesh.turing.untypequicode.fr/untypequicode/strapi/raw/branch/main/strapi.tar
|
|
|
|
|
docker load -i strapi.tar
|
|
|
|
|
rm strapi.tar
|
|
|
|
|
else
|
|
|
|
|
docker compose build
|
|
|
|
|
fi
|
2024-10-30 00:30:18 +01:00
|
|
|
docker compose up -d
|
|
|
|
|
echo "Strapi a été installé dans le répertoire docker"
|
|
|
|
|
else
|
|
|
|
|
echo "Strapi n'a pas été installé"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Strapi est déjà installé dans le répertoire docker"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2024-10-30 00:43:30 +01:00
|
|
|
|
|
|
|
|
cd /home/$USER
|