Files
cmss-projet/README.md
2025-11-04 07:47:26 +00:00

96 lines
2.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

🧩 Prérequis
Avant de commencer, assure-toi davoir installé :
🐳 Docker Desktop
🧠 Un terminal (macOS/Linux) ou PowerShell (Windows)
Un navigateur moderne (Chrome, Firefox, Edge, Safari)
🛠️ Installation
1⃣ Cloner le projet
git clone https://gitea.lasallesaintdenis.com/aya.ben-mabrouk/cmss-projet.git
cd infrastructure
2⃣ Rendre le script MinIO exécutable
chmod +x setup-minio/init-minio.sh
3⃣ Construire et lancer les conteneurs
docker compose down -v
docker system prune -af
docker compose up -d --build
🧱 Services inclus
Service Description Port
app Serveur PHP + Apache http://localhost:8080
mysql Base de données MySQL 8.1 localhost:3306
minio Stockage dimages (type AWS S3) http://localhost:9000
minio-console Interface web MinIO http://localhost:9001
👤 Comptes par défaut
Utilisateur Mot de passe Rôle Email
admin admin admin admin@example.com
aya ayabmk933 user aya@example.com
📦 Accès aux interfaces
🌐 CMS principal :
👉 http://localhost:8080
🗄️ MinIO Console :
👉 http://localhost:9001
Utilise minioadmin / minioadmin
📚 Explications techniques
✅ Encodage UTF-8
La base MySQL est créée avec :
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Tous les fichiers .php incluent :
<meta charset="UTF-8">
La connexion PDO force SET NAMES utf8mb4;
👉 Résultat : aucun problème de é, ’, etc., même sur un environnement étranger.
✅ Bucket MinIO public
Le script init-minio.sh crée automatiquement le bucket public bucketforum :
mc mb myminio/bucketforum || true
mc anonymous set public myminio/bucketforum
Toutes les images uploadées sont directement accessibles depuis :
http://localhost:9000/bucketforum/nom_fichier.png
🔍 Commandes utiles
Lister les conteneurs actifs :
docker ps
Redémarrer uniquement lapp :
docker compose restart app
Voir les logs :
docker compose logs -f
Supprimer tout (remise à zéro) :
docker compose down -v
docker system prune -af
💾 Sauvegarde / Restauration base de données
Sauvegarder :
docker exec -it mysql_container mysqldump -umyuser -pmypassword forum_database > backup.sql
Restaurer :
docker exec -i mysql_container mysql -umyuser -pmypassword forum_database < backup.sql