add Dockerfiles and update all configs for deployment

This commit is contained in:
cygouw
2026-06-11 16:17:42 +07:00
parent 5e1038180e
commit 50f64afbe7
5 changed files with 49 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
FROM php:8.2-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN a2enmod rewrite
COPY . /var/www/html/
RUN echo '<Directory /var/www/html>\n\
Options Indexes FollowSymLinks\n\
AllowOverride All\n\
Require all granted\n\
</Directory>' > /etc/apache2/conf-available/custom.conf \
&& a2enconf custom
EXPOSE 80
+4 -5
View File
@@ -2,11 +2,10 @@
// ============================================
// config.php — Konfigurasi Database SPBU
// ============================================
define('DB_HOST', 'localhost');
define('DB_USER', 'root'); // Ganti jika perlu
define('DB_PASS', ''); // Ganti jika perlu
define('DB_NAME', 'webgis_spbu');
define('DB_HOST', getenv('DB_HOST') ?: 'localhost');
define('DB_USER', getenv('DB_USER') ?: 'root');
define('DB_PASS', getenv('DB_PASS') ?: '');
define('DB_NAME', getenv('DB_NAME') ?: 'webgis_spbu');
function getConnection() {
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);