Add dockerfile and update config file
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
FROM php:8.2-apache
|
||||
|
||||
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
|
||||
|
||||
RUN a2enmod rewrite
|
||||
|
||||
COPY . /var/www/html/
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/html \
|
||||
&& chmod -R 755 /var/www/html
|
||||
|
||||
EXPOSE 80
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
define('DB_HOST', getenv('DB_HOST'));
|
||||
define('DB_USER', getenv('DB_USER'));
|
||||
define('DB_PASS', getenv('DB_PASS'));
|
||||
define('DB_NAME', getenv('DB_NAME'));
|
||||
|
||||
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
if ($conn->connect_error) {
|
||||
die("Koneksi gagal: " . $conn->connect_error);
|
||||
}
|
||||
?>
|
||||
+1
-5
@@ -1,7 +1,3 @@
|
||||
<?php
|
||||
$conn = new mysqli("localhost", "root", "", "webgis");
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die("Koneksi gagal: " . $conn->connect_error);
|
||||
}
|
||||
require_once 'config.php';
|
||||
?>
|
||||
Reference in New Issue
Block a user