feat: add auto DB import entrypoint script

This commit is contained in:
2026-06-10 17:26:25 +07:00
parent 3d608e6508
commit f97c40317c
2 changed files with 38 additions and 2 deletions
+9 -2
View File
@@ -1,16 +1,23 @@
FROM php:8.2-apache
# Install ekstensi mysqli dan pdo_mysql untuk koneksi ke database
# Install mysql client dan ekstensi PHP
RUN apt-get update && apt-get install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable mysqli
# Aktifkan mod_rewrite Apache (berguna untuk URL yang bersih/routing)
# Aktifkan mod_rewrite Apache
RUN a2enmod rewrite
# Copy semua file project ke dalam container
COPY . /var/www/html/
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Update permissions
RUN chown -R www-data:www-data /var/www/html
# Expose port Apache
EXPOSE 80
ENTRYPOINT ["docker-entrypoint.sh"]