Skip to content

Docker Image missing dependencies for plugin system #2025

@Drummss

Description

@Drummss

Current Behavior

When you try to install a plugin that has composer package dependencies I believe it fails because composer is not available in the runtime Docker image.

[object] (Exception(code: 0): Could not require new composer packages: sh: exec: line 0: composer: not found
at /var/www/html/app/Services/Helpers/PluginService.php:206)
[stacktrace]
#0 /var/www/html/app/Services/Helpers/PluginService.php(275): App\\Services\\Helpers\\PluginService->manageComposerPackages(Array)
#1 /var/www/html/app/Filament/Admin/Resources/Plugins/PluginResource.php(122): App\\Services\\Helpers\\PluginService->installPlugin(Object(App\\Models\\Plugin), true)

Expected Behavior

Plugins should install correctly even when they have composer package dependencies. The current Docker image is following best practices - as build tooling is not usually included in runtime images. However, as the plugin system uses composer to install packages dynamically at run time, the runtime image will need to support the use of composer, or the system will need to be changed to have the packages included at runtime in a different way. Perhaps an alternative could be bundling the packages with the plugin - though I don't love that approach myself. Or maybe a service that lets you download the package directly over HTTP rather than using the composer tool itself.

Another thing to note: assuming that the plugin's composer packages are installed into vendor, there will need to be some way to restore the packages each time the container is started. This could be as simple as volume mounting the vendor folder onto the host system - though I'm not sure if that is a good idea. The plugin system could be changed to install packages on each startup. Or perhaps the plugins could install composer packages into it's own folder (such as plugins/vendor or localizing it further like plugins/player-counter/vendor - as the plugins folder gets mounted onto the host already.

It's possible that that yarn may also need to be installed into the runtime image, along with a way of persisting installed node packages.

Steps to Reproduce

Using the the Panel running with the provided Docker image: try to install a plugin that have composer package dependencies. An example of one would be the player-counter plugin. The plugin will not work correctly, as well as the migrations not being run (which I believe is due to the plugin install code failing before it gets to running the migrations).

Panel Version

beta30

Wings Version

beta21

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions