tntprojects commited on
Commit
1ae0b96
verified
1 Parent(s): 2376c83

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -1,28 +1,37 @@
1
  FROM wordpress:latest
2
 
 
3
  RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf
4
  RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
5
 
 
6
  RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev unzip \
7
  && docker-php-ext-install pdo pdo_sqlite
8
 
 
9
  ADD https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip /tmp/sqlite-integration.zip
10
  RUN unzip /tmp/sqlite-integration.zip -d /var/www/html/wp-content/plugins/
11
  RUN cp /var/www/html/wp-content/plugins/sqlite-integration/db.php /var/www/html/wp-content/db.php
12
 
13
- # Crear el wp-config directamente
 
 
 
 
 
14
  RUN echo "<?php \
15
  define('DB_NAME', 'local_db'); \
16
  define('DB_USER', 'root'); \
17
  define('DB_PASSWORD', 'root'); \
18
  define('DB_HOST', 'localhost'); \
19
  \$table_prefix = 'wp_'; \
20
- define('WP_DEBUG', true); \
21
  if ( ! defined( 'ABSOLUTE_PATH' ) ) { define( 'ABSOLUTE_PATH', __DIR__ . '/' ); } \
22
  require_once ABSOLUTE_PATH . 'wp-settings.php';" > /var/www/html/wp-config.php
23
 
24
- # PERMISOS AGRESIVOS: Necesarios para que SQLite cree el archivo .ht.sqlite
25
  RUN chmod -R 777 /var/www/html/wp-content
 
26
 
27
  EXPOSE 7860
28
  CMD ["apache2-foreground"]
 
1
  FROM wordpress:latest
2
 
3
+ # 1. Ajuste de puertos para Hugging Face
4
  RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf
5
  RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
6
 
7
+ # 2. Instalaci贸n de SQLite y herramientas
8
  RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev unzip \
9
  && docker-php-ext-install pdo pdo_sqlite
10
 
11
+ # 3. Descarga y preparaci贸n del plugin
12
  ADD https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip /tmp/sqlite-integration.zip
13
  RUN unzip /tmp/sqlite-integration.zip -d /var/www/html/wp-content/plugins/
14
  RUN cp /var/www/html/wp-content/plugins/sqlite-integration/db.php /var/www/html/wp-content/db.php
15
 
16
+ # 4. --- EL PARCHE BRUTAL ---
17
+ # Este comando repara el error de la l铆nea 788 y otros similares
18
+ # cambiando las llaves { } por corchetes [ ] en el archivo problem谩tico.
19
+ RUN sed -i 's/{\([0-9a-zA-Z_]*\)}/[\1]/g' /var/www/html/wp-content/plugins/sqlite-integration/pdoengine.class.php
20
+
21
+ # 5. Crear el wp-config autom谩ticamente
22
  RUN echo "<?php \
23
  define('DB_NAME', 'local_db'); \
24
  define('DB_USER', 'root'); \
25
  define('DB_PASSWORD', 'root'); \
26
  define('DB_HOST', 'localhost'); \
27
  \$table_prefix = 'wp_'; \
28
+ define('WP_DEBUG', false); \
29
  if ( ! defined( 'ABSOLUTE_PATH' ) ) { define( 'ABSOLUTE_PATH', __DIR__ . '/' ); } \
30
  require_once ABSOLUTE_PATH . 'wp-settings.php';" > /var/www/html/wp-config.php
31
 
32
+ # 6. Permisos totales para que SQLite pueda escribir su base de datos
33
  RUN chmod -R 777 /var/www/html/wp-content
34
+ RUN chown -R www-data:www-data /var/www/html/
35
 
36
  EXPOSE 7860
37
  CMD ["apache2-foreground"]