processwire / processwire-issues

ProcessWire issue reports.
45 stars 2 forks source link

Installer not compatible with DDEV #1961

Open BernhardBaumrock opened 2 months ago

BernhardBaumrock commented 2 months ago

Short description of the issue

DDEV is a great docker based development environment. I wanted to add it to the list of supported CMSs here: https://ddev.readthedocs.io/en/stable/users/quickstart/

While trying to find the best commands I found out that when using the config option --upload-dirs='site/assets/files' the processwire installer won't run properly.

Expected behavior

It should be able to use --upload-dirs='site/assets/files' in DDEV and still be able to install PW.

Actual behavior

Please see the screenshot of the problem here: https://github.com/ddev/ddev/issues/6381#issuecomment-2296974294

Explanation

The "upload-dirs" config setting tells DDEV to bind-mount that directory to the container. If that is not set, ddev will always show a warning about it being not defined. Also DDEV has a feature called "mutagen" which will create full copies of all files inside the container rather than mounting the whole folder. This is great for performance (very fast load times), but it is not so great when large files have to be synced.

That's why I recommend adding /site/assets/files to the upload_dirs setting, but everybody can add any other folders as well (like site/assets/cache or such).

Optional: Suggestion for a possible fix

In the linked issue above I asked if DDEV can do anything about the issue, but I got the answer that the folder needs to be created on startup so that docker can mount it properly, which makes sense. So I think PW should be a little more specific about the check if PW is already installed and not only check for the "site" folder being present.

For example it could check for /site and /site/config.php and only in that case jump to the next step of the installation.

Steps to reproduce the issue

  1. Download PW
  2. Create an empty folder /site/assets/files
  3. Run the installer
rfay commented 2 months ago

It's not actually that it's not compatible with DDEV, it's that it's using too simplistic a technique to see if the site has been installed. It could look for what's inside the site directory instead of just its existence.

(This is also only when performance_mode: mutagen, which is the default for macOS.) It won't happen on Linux/WSL2. The actual mechanics are described in https://github.com/ddev/ddev/issues/6381#issuecomment-2297225086

BernhardBaumrock commented 2 months ago

It's not actually that it's not compatible with DDEV, it's that it's using too simplistic a technique to see if the site has been installed. It could look for what's inside the site directory instead of just its existence.

Yeah that's what I suggested as possible fix :)

(This is also only when performance_mode: mutagen, which is the default for macOS.) It won't happen on Linux/WSL2. The actual mechanics are described in https://github.com/ddev/ddev/issues/6381#issuecomment-2297225086

Thx for the clarification!