Init project

This commit is contained in:
Matthieu LEMAIRE
2025-10-19 19:02:25 +02:00
commit fea5629530
10 changed files with 130 additions and 0 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/CMS-BTS-Ciel.iml generated Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/CMS-BTS-Ciel.iml" filepath="$PROJECT_DIR$/.idea/CMS-BTS-Ciel.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM php:8.2-apache
LABEL authors="matthieulmr"
COPY . /var/www/html
WORKDIR /var/www/html
RUN docker-php-ext-install pdo pdo_mysql
EXPOSE 80

48
README.md Normal file
View File

@@ -0,0 +1,48 @@
# Projet CMS Simplifié
### Technologies utilisées
Ce projet a été construit avec les technologies suivantes :
![HTML5](https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge&logo=html5&logoColor=white)
![CSS3](https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge&logo=css3&logoColor=white)
![PHP](https://img.shields.io/badge/PHP-777BB4?style=for-the-badge&logo=php&logoColor=white)
![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge&logo=mysql&logoColor=white)
## Lancement des dockers MySql et Php
### Création d'un réseau pour que les services docker puissent communiquer
```bash
docker network create -d bridge CMS-bridge
```
### Build BDD
Builder la BDD MySql avec le Dockerfile présent dans le répertoire bdd
```bash
docker build -t cms_mysql .
```
Lancer l'image créée en le connectant au réseau précédemment créé
```bash
docker run -d --name CMS_mysql -p 3306:3306 --network=CMS-bridge cms_mysql:latest
```
### Build PHP-Apache
Builder PHP Apache avec le Dockerfile présent à la racine du projet
```bash
docker build -t cms_php .
```
Lancer l'image créée en le connectant au réseau précédemment créé
```bash
docker run -d --name CMS_php -p 8080:80 --network=CMS-bridge cms_php:latest
```
Pour éviter de lancer les commandes à chaque fois, un script launch-dockers.sh a executer en 'sudo' est disponible.

8
bdd/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM mysql
LABEL authors="matthieulmr"
ENV MYSQL_ROOT_PASSWORD='passwordRoot'
COPY ./init.sql /docker-entrypoint-initdb.d/
EXPOSE 3306

3
bdd/init.sql Normal file
View File

@@ -0,0 +1,3 @@
CREATE DATABASE IF NOT EXISTS cms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE cms;

25
launch-dockers.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
docker stop CMS_mysql
docker stop CMS_php
docker rm CMS_mysql
docker rm CMS_php
docker network rm CMS-bridge
docker network create -d bridge CMS-bridge
cd bdd
docker build -t cms_mysql .
docker run -d --name CMS_mysql -p 3306:3306 --network=CMS-bridge cms_mysql:latest
cd ..
docker build -t cms_php .
docker run -d --name CMS_php -p 8080:80 --network=CMS-bridge cms_php:latest