Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +25 -14
Dockerfile
CHANGED
|
@@ -18,26 +18,37 @@ RUN curl -o sqlite-plugin.zip https://downloads.wordpress.org/plugin/sqlite-data
|
|
| 18 |
&& unzip sqlite-plugin.zip -d /var/www/html/wp-content/plugins/ \
|
| 19 |
&& rm sqlite-plugin.zip
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN mkdir -p /var/www/html/wp-content
|
| 23 |
-
|
| 24 |
-
# Debug: Lihat struktur direktori plugin
|
| 25 |
-
RUN ls -la /var/www/html/wp-content/plugins/sqlite-database-integration/
|
| 26 |
-
|
| 27 |
-
# Copy db.php dari lokasi yang benar
|
| 28 |
RUN cp /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/db.php /var/www/html/wp-content/db.php
|
| 29 |
|
| 30 |
# Create SQLite database directory
|
| 31 |
-
RUN mkdir -p /var/www/html/wp-content/database
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
RUN
|
| 35 |
-
&& chmod 755 /var/www/html/wp-content/db.php \
|
| 36 |
-
&& chmod 755 /var/www/html/wp-content/database
|
| 37 |
|
| 38 |
-
# Ubah Apache ke port 7860
|
| 39 |
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
|
| 40 |
-
&& sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
EXPOSE 7860
|
| 43 |
CMD ["apache2-foreground"]
|
|
|
|
| 18 |
&& unzip sqlite-plugin.zip -d /var/www/html/wp-content/plugins/ \
|
| 19 |
&& rm sqlite-plugin.zip
|
| 20 |
|
| 21 |
+
# Copy SQLite drop-in dari lokasi yang benar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN cp /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/db.php /var/www/html/wp-content/db.php
|
| 23 |
|
| 24 |
# Create SQLite database directory
|
| 25 |
+
RUN mkdir -p /var/www/html/wp-content/database && \
|
| 26 |
+
touch /var/www/html/wp-content/database/.htaccess && \
|
| 27 |
+
echo "Deny from all" > /var/www/html/wp-content/database/.htaccess
|
| 28 |
+
|
| 29 |
+
# Copy custom wp-config.php
|
| 30 |
+
COPY wp-config.php /var/www/html/wp-config.php
|
| 31 |
+
|
| 32 |
+
# Set permissions
|
| 33 |
+
RUN chown -R www-data:www-data /var/www/html && \
|
| 34 |
+
chmod 755 /var/www/html/wp-content/db.php && \
|
| 35 |
+
chmod 755 /var/www/html/wp-config.php && \
|
| 36 |
+
chmod 755 -R /var/www/html/wp-content/database
|
| 37 |
|
| 38 |
+
# Enable mod_rewrite untuk pretty URLs
|
| 39 |
+
RUN a2enmod rewrite
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
# Ubah Apache ke port 7860 dan konfigurasi
|
| 42 |
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
|
| 43 |
+
&& sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf \
|
| 44 |
+
&& sed -i 's|/var/www/html|/var/www/html|g' /etc/apache2/sites-available/000-default.conf
|
| 45 |
+
|
| 46 |
+
# Apache configuration untuk WordPress
|
| 47 |
+
RUN echo "<Directory /var/www/html>" >> /etc/apache2/sites-available/000-default.conf \
|
| 48 |
+
&& echo " Options FollowSymLinks" >> /etc/apache2/sites-available/000-default.conf \
|
| 49 |
+
&& echo " AllowOverride All" >> /etc/apache2/sites-available/000-default.conf \
|
| 50 |
+
&& echo " Require all granted" >> /etc/apache2/sites-available/000-default.conf \
|
| 51 |
+
&& echo "</Directory>" >> /etc/apache2/sites-available/000-default.conf
|
| 52 |
|
| 53 |
EXPOSE 7860
|
| 54 |
CMD ["apache2-foreground"]
|