35 lines
1.3 KiB
Bash
Executable File
35 lines
1.3 KiB
Bash
Executable File
# 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
|
|
read -p "Voulez-vous installer strapi dans le répertoire docker ? (o/n) " response
|
|
if [[ $response =~ ^[Oo]$ ]]; then
|
|
cd /home/$USER/docker
|
|
curl -o strapi.zip https://ganesh.turing.untypequicode.fr/untypequicode/strapi/archive/v0.1.zip
|
|
if command -v unzip &> /dev/null; then
|
|
unzip strapi.zip
|
|
else
|
|
apt-get install unzip
|
|
unzip strapi.zip
|
|
fi
|
|
rm strapi.zip
|
|
cd strapi
|
|
read -p "Voulez-vous installer l'image déjà compilée ? (o/n) " response
|
|
if [[ $response =~ ^[Oo]$ ]]; then
|
|
curl -O https://ganesh.turing.untypequicode.fr/untypequicode/script-vps/raw/branch/main/strapi.tar
|
|
docker load -i strapi.tar
|
|
rm strapi.tar
|
|
else
|
|
docker compose build
|
|
fi
|
|
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
|
|
|
|
cd /home/$USER
|