From a4888e33f99005c69df4b50f5b2efe0f7df4e870 Mon Sep 17 00:00:00 2001 From: miaaurl Date: Thu, 11 Jun 2026 16:52:43 +0700 Subject: [PATCH] Add Dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e78114e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# 1. Gunakan base image resmi PHP yang sudah include Apache web server +FROM php:8.2-apache + +# 2. Instal library sistem yang dibutuhkan untuk ekstensi zip +RUN apt-get update && apt-get install -y \ + libzip-dev \ + zip \ + && rm -rf /var/lib/apt/lists/* + +# 3. Instal ekstensi PHP mysqli (untuk DB) dan zip (untuk SimpleXLSX) +RUN docker-php-ext-install mysqli zip + +# 4. Aktifkan modul rewrite Apache (berguna untuk routing/URL jika diperlukan) +RUN a2enmod rewrite + +# 5. Salin seluruh isi folder projek lokal ke dalam folder web Apache di server +COPY . /var/www/html/ + +# 6. Atur hak akses (permissions) agar Apache bisa membaca dan menulis file (penting untuk upload foto!) +RUN chown -R www-data:www-data /var/www/html \ + && chmod -R 755 /var/www/html + +# 7. Buka port 80 agar website bisa diakses melalui internet +EXPOSE 80 \ No newline at end of file