Spaces:
Sleeping
Sleeping
| FROM php:8.2-apache | |
| # Install extensions dan dependencies | |
| RUN docker-php-ext-install mysqli pdo pdo_mysql && \ | |
| apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /var/www/html | |
| # Download dan extract WordPress | |
| RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz && \ | |
| tar -xvzf wordpress.tar.gz --strip-components=1 && \ | |
| rm wordpress.tar.gz | |
| # Set permissions yang benar (tanpa chmod recursive yang berlebihan) | |
| RUN chown -R www-data:www-data /var/www/html && \ | |
| find /var/www/html -type d -exec chmod 755 {} \; && \ | |
| find /var/www/html -type f -exec chmod 644 {} \; | |
| # Ubah Apache ke port 7860 (HANYA di satu tempat) | |
| RUN sed -i 's/Listen 80/Listen 7860/g' /etc/apache2/ports.conf && \ | |
| sed -i 's/:80/:7860/g' /etc/apache2/sites-available/*.conf | |
| # Enable mod rewrite | |
| RUN a2enmod rewrite | |
| EXPOSE 7860 | |
| CMD ["apache2-foreground"] |