Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295743

Add Caddyfile configuration

$
0
0

Problem/Motivation

We should introduce a Caddyfile configuration to enable Drupal to be served by caddy. It would also make it possible to use FrankenPHP easily, and benefit from all it's features such as, server sent events, early hints to load assets faster, etc.

Later, once #2218651: [meta] Make Drupal compatible with persistent app servers like ReactPHP, PHP-PM, PHPFastCGI, FrankenPHP, Swoole is in a good state, we can enable the worker mode of FrankenPHP and improve performance. The end goal would be to recommend FrankenPHP as the way to deploy Drupal on production.

We can also make use of FrankenPHP static binary to provide a PHP-cli and make it possible to use and serve Drupal (including composer and drush) from an environement that does not have PHP installed. From what I tried the following works:

# download the relevant binary for you system from https://github.com/dunglas/frankenphp/releases
# download composer https://getcomposer.org/download/
$ frankenphp php-cli ~/opt/bin/composer create-project drupal/recommended-project look_no_hands
$ cd look_no_hands
$ frankenphp php-cli ~/opt/bin/composer require drush/drush
$ cd web
$ frankenphp run

You have a Drupal up and running on a system without PHP installed, you used composer and drush works. While this is out of scope for this issue, it is to give an idea about how it can be used and the relevance of adding a Caddyfile to core. There is a docker way of doing all this, but I wanted to highlight the simplest way it can be made to work.

Proposed resolution

Add a Caddyfile to core, next to .htaccess, taking inspiration from the frankenphp-drupal config.

Remaining tasks

Release notes snippet

TODO


Viewing all articles
Browse latest Browse all 295743