add lightweight Dockerfile for Coolify
This commit is contained in:
+7
-5
@@ -1,6 +1,8 @@
|
|||||||
.git
|
.git
|
||||||
.gitignore
|
.env
|
||||||
Dockerfile
|
*.zip
|
||||||
.dockerignore
|
*.log
|
||||||
.env.example
|
.DS_Store
|
||||||
README.md
|
Thumbs.db
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
|||||||
+4
-7
@@ -1,17 +1,14 @@
|
|||||||
FROM php:8.3-apache
|
FROM php:8.3-apache
|
||||||
|
|
||||||
# Install mysqli extension required for database connections
|
|
||||||
RUN docker-php-ext-install mysqli \
|
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
|
WORKDIR /var/www/html
|
||||||
RUN a2enmod rewrite
|
|
||||||
|
|
||||||
# Copy project files to the web server root
|
|
||||||
COPY . /var/www/html/
|
COPY . /var/www/html/
|
||||||
|
|
||||||
# Set correct ownership for Apache
|
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
# Expose port 80
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ Database dan tabel akan dibuat otomatis ketika project dijalankan.
|
|||||||
|
|
||||||
## Deploy di Coolify
|
## 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
|
Tambahkan resource MySQL ke project Coolify, lalu hubungkan aplikasi ke
|
||||||
hostname internal resource tersebut. Jangan gunakan `localhost`, karena
|
hostname internal resource tersebut. Jangan gunakan `localhost`, karena
|
||||||
`localhost` di dalam container menunjuk ke container aplikasi sendiri.
|
`localhost` di dalam container menunjuk ke container aplikasi sendiri.
|
||||||
|
|||||||
Reference in New Issue
Block a user