Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -27
Dockerfile
CHANGED
|
@@ -10,45 +10,32 @@ WORKDIR /var/www/html
|
|
| 10 |
|
| 11 |
# Download WordPress
|
| 12 |
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
|
| 13 |
-
&& tar -
|
| 14 |
&& rm wordpress.tar.gz
|
| 15 |
|
| 16 |
-
# Install SQLite plugin
|
| 17 |
RUN curl -o sqlite-plugin.zip https://downloads.wordpress.org/plugin/sqlite-database-integration.zip \
|
| 18 |
-
&& unzip sqlite-plugin.zip -d
|
| 19 |
&& rm sqlite-plugin.zip
|
| 20 |
|
| 21 |
-
# Copy
|
| 22 |
-
RUN cp
|
|
|
|
| 23 |
|
| 24 |
-
# Create
|
| 25 |
-
RUN mkdir -p
|
| 26 |
-
touch /var/www/html/wp-content/database/.htaccess && \
|
| 27 |
-
echo "Deny from all" > /var/www/html/wp-content/database/.htaccess
|
| 28 |
|
| 29 |
-
# Copy
|
| 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
|
| 35 |
-
chmod 755
|
| 36 |
-
chmod 755 -R /var/www/html/wp-content/database
|
| 37 |
|
| 38 |
-
#
|
| 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"]
|
|
|
|
| 10 |
|
| 11 |
# Download WordPress
|
| 12 |
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
|
| 13 |
+
&& tar -xzf wordpress.tar.gz --strip-components=1 \
|
| 14 |
&& rm wordpress.tar.gz
|
| 15 |
|
| 16 |
+
# Install SQLite plugin
|
| 17 |
RUN curl -o sqlite-plugin.zip https://downloads.wordpress.org/plugin/sqlite-database-integration.zip \
|
| 18 |
+
&& unzip -q sqlite-plugin.zip -d wp-content/plugins/ \
|
| 19 |
&& rm sqlite-plugin.zip
|
| 20 |
|
| 21 |
+
# Copy db.php dan perbaiki path yang salah
|
| 22 |
+
RUN cp wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/db.php wp-content/ \
|
| 23 |
+
&& sed -i "s|/var/www/version.php|/var/www/html/wp-includes/version.php|g" wp-content/db.php
|
| 24 |
|
| 25 |
+
# Create database directory
|
| 26 |
+
RUN mkdir -p wp-content/database
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
# Copy wp-config
|
| 29 |
COPY wp-config.php /var/www/html/wp-config.php
|
| 30 |
|
| 31 |
# Set permissions
|
| 32 |
+
RUN chown -R www-data:www-data /var/www/html \
|
| 33 |
+
&& chmod 755 wp-content/db.php \
|
| 34 |
+
&& chmod 755 wp-config.php
|
|
|
|
| 35 |
|
| 36 |
+
# Configure Apache
|
|
|
|
|
|
|
|
|
|
| 37 |
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
|
| 38 |
+
&& sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
EXPOSE 7860
|
| 41 |
CMD ["apache2-foreground"]
|