Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer not running in Dockerfiles. #518

Open
sylvain-sonnen opened this issue Mar 12, 2024 · 1 comment
Open

Installer not running in Dockerfiles. #518

sylvain-sonnen opened this issue Mar 12, 2024 · 1 comment

Comments

@sylvain-sonnen
Copy link

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.

@NoelLH
Copy link
Contributor

NoelLH commented Mar 13, 2024

Hey @sylvain-sonnen, I think this will be hard to work out without knowing more about the project structure – volume mounts etc.

I'm pretty sure I have successfully used Wpackagist in Docker with existing, hard-coded plugins in the installer-paths alongside the Wpackagist ones.

As far as your Wpackagist plugin install goes, the first thing I'd try is removing --ignore-platform-reqs --no-interaction --quiet so you get more output and get some more assurance that your system is compatible with the packages you're asking for – at least the non-WordPress ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants