From 37a94c8080e87062c23ee31da0a20d89dd10d2d3 Mon Sep 17 00:00:00 2001 From: Anderi Saputra Date: Wed, 10 Jun 2026 18:33:54 +0700 Subject: [PATCH] add lightweight Dockerfile for Coolify --- .dockerignore | 12 +++++++----- Dockerfile | 11 ++++------- README.md | 4 ++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.dockerignore b/.dockerignore index a0cb5f1..0f72959 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,8 @@ .git -.gitignore -Dockerfile -.dockerignore -.env.example -README.md +.env +*.zip +*.log +.DS_Store +Thumbs.db +.idea +.vscode diff --git a/Dockerfile b/Dockerfile index 5ec4ff5..7d6ca20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,14 @@ FROM php:8.3-apache -# Install mysqli extension required for database connections RUN docker-php-ext-install mysqli \ - && docker-php-ext-enable mysqli + && a2enmod rewrite \ + && printf "ServerName localhost\n" > /etc/apache2/conf-available/servername.conf \ + && a2enconf servername -# Enable Apache mod_rewrite for routing if needed -RUN a2enmod rewrite +WORKDIR /var/www/html -# Copy project files to the web server root COPY . /var/www/html/ -# Set correct ownership for Apache RUN chown -R www-data:www-data /var/www/html -# Expose port 80 EXPOSE 80 diff --git a/README.md b/README.md index 89f930a..19c6cb8 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ Database dan tabel akan dibuat otomatis ketika project dijalankan. ## Deploy di Coolify +Project ini menyediakan `Dockerfile` ringan berbasis `php:8.3-apache`. +Di Coolify, gunakan build pack **Dockerfile** agar deploy tidak memakai +Nixpacks yang lebih berat. + Tambahkan resource MySQL ke project Coolify, lalu hubungkan aplikasi ke hostname internal resource tersebut. Jangan gunakan `localhost`, karena `localhost` di dalam container menunjuk ke container aplikasi sendiri.