mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
feat: add support for SERVER_ROOT to provide a different app root (#1678)
This commit is contained in:
committed by
GitHub
parent
cfb9d9f895
commit
b2435183f4
@@ -25,7 +25,7 @@
|
|||||||
#}
|
#}
|
||||||
|
|
||||||
root {$SERVER_ROOT:public/}
|
root {$SERVER_ROOT:public/}
|
||||||
encode zstd br gzip
|
encode zstd br gzip
|
||||||
|
|
||||||
# Uncomment the following lines to enable Mercure and Vulcain modules
|
# Uncomment the following lines to enable Mercure and Vulcain modules
|
||||||
#mercure {
|
#mercure {
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ You can find more information about this setting in the [Caddy documentation](ht
|
|||||||
The following environment variables can be used to inject Caddy directives in the `Caddyfile` without modifying it:
|
The following environment variables can be used to inject Caddy directives in the `Caddyfile` without modifying it:
|
||||||
|
|
||||||
- `SERVER_NAME`: change [the addresses on which to listen](https://caddyserver.com/docs/caddyfile/concepts#addresses), the provided hostnames will also be used for the generated TLS certificate
|
- `SERVER_NAME`: change [the addresses on which to listen](https://caddyserver.com/docs/caddyfile/concepts#addresses), the provided hostnames will also be used for the generated TLS certificate
|
||||||
|
- `SERVER_ROOT`: change the root directory of the site, defaults to `public/`
|
||||||
- `CADDY_GLOBAL_OPTIONS`: inject [global options](https://caddyserver.com/docs/caddyfile/options)
|
- `CADDY_GLOBAL_OPTIONS`: inject [global options](https://caddyserver.com/docs/caddyfile/options)
|
||||||
- `FRANKENPHP_CONFIG`: inject config under the `frankenphp` directive
|
- `FRANKENPHP_CONFIG`: inject config under the `frankenphp` directive
|
||||||
|
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ Vous trouverez plus d'informations sur ce paramètre dans la [documentation Cadd
|
|||||||
Les variables d'environnement suivantes peuvent être utilisées pour insérer des directives Caddy dans le `Caddyfile` sans le modifier :
|
Les variables d'environnement suivantes peuvent être utilisées pour insérer des directives Caddy dans le `Caddyfile` sans le modifier :
|
||||||
|
|
||||||
- `SERVER_NAME` : change [les adresses sur lesquelles écouter](https://caddyserver.com/docs/caddyfile/concepts#addresses), les noms d'hôte fournis seront également utilisés pour le certificat TLS généré
|
- `SERVER_NAME` : change [les adresses sur lesquelles écouter](https://caddyserver.com/docs/caddyfile/concepts#addresses), les noms d'hôte fournis seront également utilisés pour le certificat TLS généré
|
||||||
|
- `SERVER_ROOT` : change le répertoire racine du site, par défaut `public/`
|
||||||
- `CADDY_GLOBAL_OPTIONS` : injecte [des options globales](https://caddyserver.com/docs/caddyfile/options)
|
- `CADDY_GLOBAL_OPTIONS` : injecte [des options globales](https://caddyserver.com/docs/caddyfile/options)
|
||||||
- `FRANKENPHP_CONFIG` : insère la configuration sous la directive `frankenphp`
|
- `FRANKENPHP_CONFIG` : insère la configuration sous la directive `frankenphp`
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ ENV SERVER_NAME=your-domain-name.example.com
|
|||||||
# Si vous souhaitez désactiver HTTPS, utilisez cette valeur à la place :
|
# Si vous souhaitez désactiver HTTPS, utilisez cette valeur à la place :
|
||||||
#ENV SERVER_NAME=:80
|
#ENV SERVER_NAME=:80
|
||||||
|
|
||||||
|
# Si votre projet n'utilise pas le répertoire "public" comme racine web, vous pouvez le définir ici :
|
||||||
|
# ENV SERVER_ROOT=web/
|
||||||
|
|
||||||
# Activer les paramètres de production de PHP
|
# Activer les paramètres de production de PHP
|
||||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ ENV SERVER_NAME=your-domain-name.example.com
|
|||||||
# If you want to disable HTTPS, use this value instead:
|
# If you want to disable HTTPS, use this value instead:
|
||||||
#ENV SERVER_NAME=:80
|
#ENV SERVER_NAME=:80
|
||||||
|
|
||||||
|
# If your project is not using the "public" directory as the web root, you can set it here:
|
||||||
|
# ENV SERVER_ROOT=web/
|
||||||
|
|
||||||
# Enable PHP production settings
|
# Enable PHP production settings
|
||||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user