alphabagibagi commited on
Commit
a07536e
·
verified ·
1 Parent(s): 06e65b5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -28
Dockerfile CHANGED
@@ -1,39 +1,17 @@
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 -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
 
 
1
  FROM php:8.2-apache
2
 
3
+ RUN docker-php-ext-install mysqli pdo pdo_mysql
 
 
 
 
4
 
5
+ RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
6
 
7
+ WORKDIR /var/www/html
8
  RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
9
+ && tar -xvzf wordpress.tar.gz --strip-components=1 \
10
  && rm wordpress.tar.gz
11
 
12
+ RUN chown -R www-data:www-data /var/www/html
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ # Ubah Apache ke port 7860
15
  RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
16
  && sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
17