feat: Mise à jour des Dockerfile préparation d'un environnement de démo [#12]

This commit is contained in:
Luc SORIGNET
2025-02-15 15:16:10 +01:00
parent aef6c193b1
commit 32a77c780a
5 changed files with 184 additions and 1 deletions

53
ci-script/makeDocker.sh Normal file
View File

@ -0,0 +1,53 @@
#!/bin/bash
# Récupération de la version depuis les arguments
VERSION=$1
if [ -z "$VERSION" ]; then
echo "Erreur: Version non spécifiée"
echo "Usage: ./makeDocker.sh <version>"
exit 1
fi
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_PATH
# Configuration
DOCKER_REGISTRY="git.v0id.ovh"
APP_NAME="n3wt-school"
echo "Début de la construction des images Docker pour la version ${VERSION}"
# Construction de l'image Frontend
echo "Construction de l'image Frontend..."
cd ../Front-End
docker build \
--build-arg BUILD_MODE=production \
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/frontend:${VERSION} \
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/frontend:latest \
.
if [ $? -ne 0 ]; then
echo "Échec de la construction de l'image Frontend"
exit 1
fi
# Construction de l'image Backend
echo "Construction de l'image Backend..."
cd ../Back-End
docker build \
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/backend:${VERSION} \
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/backend:latest \
.
if [ $? -ne 0 ]; then
echo "Échec de la construction de l'image Backend"
exit 1
fi
echo "Construction des images Docker terminée avec succès"
echo "Images créées :"
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/frontend:${VERSION}"
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/frontend:latest"
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/backend:${VERSION}"
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/backend:latest"
exit 0