Fix volume mapping so Composer‑installed plugins persist and load correctly

main
RadioParalelo 2026-03-05 08:03:57 +00:00
parent de80164488
commit d6cac418a0
3 changed files with 11 additions and 21 deletions

View File

@ -1,4 +1,4 @@
FROM wordpress:php8.2-apache
FROM wordpress:php8.2-apache AS base
# -------------------------------------------------
# 1⃣ Remove bundled themes (keep only core)
@ -56,7 +56,12 @@ RUN mkdir -p /var/www/html/wp-content/uploads && \
chmod -R 775 /var/www/html/wp-content
# -------------------------------------------------
# 9⃣ Install plugins via Composer **after** core is present
# 8⃣ Ensure plugins directory exists before Composer
# -------------------------------------------------
RUN mkdir -p wp-content/plugins
# -------------------------------------------------
# 9⃣ **Install plugins via Composer after core exists**
# -------------------------------------------------
COPY composer.json composer.lock ./
RUN composer install --no-dev --optimize-autoloader && \

View File

@ -1,7 +1,6 @@
{
"name": "indymedia/indymedia-wordpress",
"version": "0.1.0",
"require": {
"composer/installers": "^2.2",
"wpackagist-plugin/activitypub": "^2.0",
"wpackagist-plugin/antispam-bee": "^2.11",
"wpackagist-plugin/archiveo-importer-wayback": "*",
@ -20,21 +19,6 @@
"wpackagist-plugin/webmention": "^5.0",
"wpackagist-plugin/wp-super-cache": "^2.0"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": true

View File

@ -11,7 +11,7 @@ services:
WORDPRESS_DB_PASSWORD: wp_pass
WORDPRESS_DB_NAME: wp_db
volumes:
- ./wp-data/plugins:/var/www/html/wp-content/plugins
# - ./wp-data/plugins:/var/www/html/wp-content/plugins
- ./wp-data/uploads:/var/www/html/wp-content/uploads
- ./config/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro
- ./theme/images:/var/www/html/wp-content/uploads/theme-images:ro
@ -42,4 +42,5 @@ services:
WORDPRESS_DB_PASSWORD: wp_pass
WORDPRESS_DB_NAME: wp_db
volumes:
- ./wp-data:/var/www/html # core files + composer.json
- ./composer.json:/var/www/html/composer.json:ro
- ./composer.lock:/var/www/html/composer.lock:ro