Skip to content

Installer not running in Dockerfiles.  #518

@sylvain-sonnen

Description

@sylvain-sonnen

Hi guys,

I can't seem to make this work, I can't to find the right combo:

I have the following composer.json:

{
  "name": "vendor_name/wordpress",
  "description": "description",
  "minimum-stability": "stable",
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org",
      "only": [
        "wpackagist-plugin/*",
        "wpackagist-theme/*"
      ]
    }
  ],
  "require": {
    "php": ">= 8.2",
    "johnpbloch/wordpress": "6.4.3",
    "wpackagist-plugin/wp-graphql": "1.16.0"
  },
  "config": {
    "allow-plugins": {
      "johnpbloch/wordpress-core-installer": true,
      "composer/installers": true
    }
  },
  "extra": {
    "installer-paths": {
      "wordpress/wp-content/plugins/{$name}/": [
        "type:wordpress-plugin"
      ],
      "wordpress/wp-content/themes/{$name}/": [
        "type:wordpress-theme"
      ]
    }
  }
}

and this Dockerfile

FROM composer:latest AS composer
WORKDIR /app
COPY . ./
RUN composer install --ignore-platform-reqs --no-interaction --quiet --optimize-autoloader --no-dev

There is already a plugin in /wordpress/wp-content/plugins and a theme in ./wordpress/wp-content/themes.

When I docker build, Wordpress gets installed in the ./wordpress folder correctly. However all the plugins that existed before are gone and the one specified in the composer.json file are not there (the remain in the /vendor and re not processed)

If I run composer install locally, it behaves as expected.

Any clue what step I am missing?

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions