Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM php:8.2-apache
|
| 2 |
+
|
| 3 |
+
# Install dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
curl unzip sqlite3 libsqlite3-dev \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 7 |
+
&& docker-php-ext-install pdo pdo_sqlite
|
| 8 |
+
|
| 9 |
+
WORKDIR /var/www/html
|
| 10 |
+
|
| 11 |
+
# Download WordPress
|
| 12 |
+
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
|
| 13 |
+
&& tar -xvzf wordpress.tar.gz --strip-components=1 \
|
| 14 |
+
&& rm wordpress.tar.gz
|
| 15 |
+
|
| 16 |
+
# Install SQLite plugin untuk WordPress
|
| 17 |
+
RUN curl -o sqlite-plugin.zip https://downloads.wordpress.org/plugin/sqlite-database-integration.zip \
|
| 18 |
+
&& unzip sqlite-plugin.zip -d /var/www/html/wp-content/plugins/ \
|
| 19 |
+
&& rm sqlite-plugin.zip
|
| 20 |
+
|
| 21 |
+
# Copy SQLite drop-in
|
| 22 |
+
RUN cp /var/www/html/wp-content/plugins/sqlite-database-integration/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 |
+
chown -R www-data:www-data /var/www/html
|
| 27 |
+
|
| 28 |
+
# Ubah Apache ke port 7860
|
| 29 |
+
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
|
| 30 |
+
&& sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
|
| 31 |
+
|
| 32 |
+
EXPOSE 7860
|
| 33 |
+
CMD ["apache2-foreground"]
|