wordpress / Dockerfile
alphabagibagi's picture
Create Dockerfile
74fb63e verified
raw
history blame
1.14 kB
FROM php:8.2-apache
# Install dependencies
RUN apt-get update && apt-get install -y \
curl unzip sqlite3 libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo pdo_sqlite
WORKDIR /var/www/html
# Download 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
# Install SQLite plugin untuk WordPress
RUN curl -o sqlite-plugin.zip https://downloads.wordpress.org/plugin/sqlite-database-integration.zip \
&& unzip sqlite-plugin.zip -d /var/www/html/wp-content/plugins/ \
&& rm sqlite-plugin.zip
# Copy SQLite drop-in
RUN cp /var/www/html/wp-content/plugins/sqlite-database-integration/db.php /var/www/html/wp-content/db.php
# Create SQLite database directory
RUN mkdir -p /var/www/html/wp-content/database && \
chown -R www-data:www-data /var/www/html
# Ubah Apache ke port 7860
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
&& sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
EXPOSE 7860
CMD ["apache2-foreground"]