Initial commit - clean and ready for Coolify
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
# 1. Menggunakan base image PHP resmi dengan Apache bawaan yang stabil
|
||||
FROM php:8.2-apache
|
||||
|
||||
# 2. Install ekstensi PDO MySQL yang wajib diperlukan untuk koneksi database proyek
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
# 3. Aktifkan modul mod_rewrite Apache (sangat berguna jika nanti memakai file .htaccess atau routing)
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# 4. Atur direktori kerja utama di dalam container
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# 5. Salin seluruh isi folder proyek lokal ke dalam container Apache
|
||||
COPY . /var/www/html/
|
||||
|
||||
# 6. Atur hak akses (ownership & permissions) agar Apache (www-data) bisa membaca file proyek
|
||||
RUN chown -R www-data:www-data /var/www/html \
|
||||
&& chmod -R 755 /var/www/html
|
||||
|
||||
# 7. Buka jalur port 80 untuk lalu lintas web di Coolify
|
||||
EXPOSE 80
|
||||
|
||||
# 8. Jalankan Apache di foreground agar container tetap hidup
|
||||
CMD ["apache2-foreground"]
|
||||
Reference in New Issue
Block a user