File size: 922 Bytes
74fb63e
 
1fa5885
 
 
74fb63e
1fa5885
a07536e
74fb63e
1fa5885
 
 
 
 
0a4076d
1fa5885
0a4076d
 
 
 
 
 
74fb63e
0a4076d
 
74fb63e
 
1fa5885
74fb63e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"]