From f4bdee474d650f40553e74c2b5f20b54085db79f Mon Sep 17 00:00:00 2001 From: Athallah Ghathfan Aqila Date: Thu, 11 Jun 2026 18:12:16 +0700 Subject: [PATCH] Add root Dockerfile, fix auth redirect for full deployment --- Dockerfile | 23 +++++++++++++++++++++++ uas/auth.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7b23e6b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM php:8.2-apache + +RUN apt-get update && apt-get install -y \ + libzip-dev zip unzip \ + libpng-dev libjpeg-dev libfreetype6-dev \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install mysqli zip gd \ + && a2enmod rewrite \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=composer:2 /usr/bin/composer /usr/bin/composer + +WORKDIR /var/www/html +COPY . . + +RUN cd uas && composer install --no-dev --optimize-autoloader --no-interaction + +RUN chown -R www-data:www-data /var/www/html \ + && chmod -R 755 /var/www/html \ + && mkdir -p uas/uploads/bukti uas/uploads/kemiskinan \ + && chown -R www-data:www-data uas/uploads/ + +EXPOSE 80 diff --git a/uas/auth.php b/uas/auth.php index 03e443f..ed0f66f 100644 --- a/uas/auth.php +++ b/uas/auth.php @@ -8,7 +8,7 @@ function requireLogin() { echo json_encode(['status' => 'error', 'message' => 'Sesi habis, silakan login kembali.']); exit; } - header('Location: /login.php'); + header('Location: /uas/login.php'); exit; } }