From 709826a53bb321f99681fb34c33bcebb39b64ff8 Mon Sep 17 00:00:00 2001 From: Freitas_Enzo Date: Wed, 3 Jun 2026 08:52:09 +0000 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"/"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++++++ config.php | 18 ++++++++++++++++++ docker-compose.yml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 Dockerfile create mode 100644 config.php create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e02fc6b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM php:8.2-apache + +RUN docker-php-ext-install mysqli + +COPY . /var/www/html/ + +RUN chown -R www-data:www-data /var/www/html/ + +EXPOSE 80 \ No newline at end of file diff --git a/config.php b/config.php new file mode 100644 index 0000000..94644f8 --- /dev/null +++ b/config.php @@ -0,0 +1,18 @@ +connect_error) { + die(json_encode(['error' => 'Connexion échouée : ' . $conn->connect_error])); + } + return $conn; +} +?> \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..71c576c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3.8' + +services: + smarthome_api: + build: . + container_name: smarthome_api + ports: + - "8080:80" + depends_on: + - smarthome_db + networks: + - smarthome_network + + smarthome_db: + image: mariadb:10.11 + container_name: smarthome_db + environment: + MYSQL_ROOT_PASSWORD: root123 + MYSQL_DATABASE: smarthome + MYSQL_USER: smarthome_user + MYSQL_PASSWORD: SH_LaSalle_SD8 + volumes: + - smarthome_data:/var/lib/mysql + networks: + - smarthome_network + +networks: + smarthome_network: + driver: bridge + +volumes: + smarthome_data: \ No newline at end of file