From c66457e587f8b5073a69c43a335409d6bbc3a841 Mon Sep 17 00:00:00 2001 From: muthianura Date: Thu, 11 Jun 2026 18:56:34 +0700 Subject: [PATCH] Add dockerfile and update config file --- Dockerfile | 10 ++++++++++ SIG2_jalantanah/Dockerfile | 12 ++++++++++++ SIG2_jalantanah/config.php | 12 ++++++++++++ SIG2_jalantanah/db2.php | 6 +----- SIG_miskin/gis/Dockerfile | 17 +++++++++++++++++ SIG_miskin/gis/config.php | 16 +++++++--------- SIG_spbu/Dockerfile | 12 ++++++++++++ SIG_spbu/config.php | 11 +++++++++++ SIG_spbu/db.php | 6 +----- 9 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 Dockerfile create mode 100644 SIG2_jalantanah/Dockerfile create mode 100644 SIG2_jalantanah/config.php create mode 100644 SIG_miskin/gis/Dockerfile create mode 100644 SIG_spbu/Dockerfile create mode 100644 SIG_spbu/config.php diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73cb7d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM php:8.2-apache + +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 \ No newline at end of file diff --git a/SIG2_jalantanah/Dockerfile b/SIG2_jalantanah/Dockerfile new file mode 100644 index 0000000..02aac92 --- /dev/null +++ b/SIG2_jalantanah/Dockerfile @@ -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 \ No newline at end of file diff --git a/SIG2_jalantanah/config.php b/SIG2_jalantanah/config.php new file mode 100644 index 0000000..9d92575 --- /dev/null +++ b/SIG2_jalantanah/config.php @@ -0,0 +1,12 @@ +set_charset("utf8"); +if ($conn->connect_error) { + die("Koneksi gagal: " . $conn->connect_error); +} +?> \ No newline at end of file diff --git a/SIG2_jalantanah/db2.php b/SIG2_jalantanah/db2.php index e254929..4d5231e 100644 --- a/SIG2_jalantanah/db2.php +++ b/SIG2_jalantanah/db2.php @@ -1,7 +1,3 @@ connect_error) { - die("Koneksi gagal: " . $conn->connect_error); -} -$conn->set_charset("utf8"); +require_once 'config.php'; ?> \ No newline at end of file diff --git a/SIG_miskin/gis/Dockerfile b/SIG_miskin/gis/Dockerfile new file mode 100644 index 0000000..5f3c095 --- /dev/null +++ b/SIG_miskin/gis/Dockerfile @@ -0,0 +1,17 @@ +FROM php:8.2-apache + +RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli \ + && apt-get update && apt-get install -y libzip-dev \ + && docker-php-ext-install zip \ + && rm -rf /var/lib/apt/lists/* + +RUN a2enmod rewrite + +COPY . /var/www/html/ + +RUN mkdir -p /var/www/html/uploads/foto_rumah \ + && chown -R www-data:www-data /var/www/html \ + && chmod -R 755 /var/www/html \ + && chmod -R 775 /var/www/html/uploads + +EXPOSE 80 \ No newline at end of file diff --git a/SIG_miskin/gis/config.php b/SIG_miskin/gis/config.php index 31f9541..36ca43a 100644 --- a/SIG_miskin/gis/config.php +++ b/SIG_miskin/gis/config.php @@ -1,14 +1,12 @@ set_charset('utf8mb4'); - if ($conn->connect_error) { - http_response_code(500); - die(json_encode(['error' => 'Database connection failed: ' . $conn->connect_error])); -} \ No newline at end of file + die("Koneksi gagal: " . $conn->connect_error); +} +?> \ No newline at end of file diff --git a/SIG_spbu/Dockerfile b/SIG_spbu/Dockerfile new file mode 100644 index 0000000..02aac92 --- /dev/null +++ b/SIG_spbu/Dockerfile @@ -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 \ No newline at end of file diff --git a/SIG_spbu/config.php b/SIG_spbu/config.php new file mode 100644 index 0000000..67837f7 --- /dev/null +++ b/SIG_spbu/config.php @@ -0,0 +1,11 @@ +connect_error) { + die("Koneksi gagal: " . $conn->connect_error); +} +?> \ No newline at end of file diff --git a/SIG_spbu/db.php b/SIG_spbu/db.php index 2749a38..4d5231e 100644 --- a/SIG_spbu/db.php +++ b/SIG_spbu/db.php @@ -1,7 +1,3 @@ connect_error) { - die("Koneksi gagal: " . $conn->connect_error); -} +require_once 'config.php'; ?> \ No newline at end of file