Téléverser les fichiers vers "/"
This commit is contained in:
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -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
|
||||
18
config.php
Normal file
18
config.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
define('DB_HOST', 'smarthome_db');
|
||||
define('DB_USER', 'smarthome_user');
|
||||
define('DB_PASSWORD', 'SH_LaSalle_SD8');
|
||||
define('DB_NAME', 'smarthome');
|
||||
define('JWT_SECRET', 'smarthome_secret_key_2024_smart_home_project_very_long_key');
|
||||
define('MQTT_BROKER', 'localhost');
|
||||
define('MQTT_PORT', 1883);
|
||||
define('MQTT_TOPIC_CLIMATE', 'smarthome/climate');
|
||||
define('MQTT_TOPIC_SECURITY', 'smarthome/security');
|
||||
function get_db() {
|
||||
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
|
||||
if ($conn->connect_error) {
|
||||
die(json_encode(['error' => 'Connexion échouée : ' . $conn->connect_error]));
|
||||
}
|
||||
return $conn;
|
||||
}
|
||||
?>
|
||||
32
docker-compose.yml
Normal file
32
docker-compose.yml
Normal file
@@ -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:
|
||||
Reference in New Issue
Block a user