Skip to content

Commit 13d9453

Browse files
committed
Ajout de la configuration du worker FrankenPHP et du mode off, ainsi que de la prise en charge de Laravel Octane dans le script d'automatisation.
1 parent 7b30608 commit 13d9453

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/common/etc/entrypoint.d/50-laravel-automations.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ script_name="laravel-automations"
1010
: "${AUTORUN_ENABLED:=false}"
1111
: "${AUTORUN_DEBUG:=false}"
1212

13-
1413
# Set default values for storage link
15-
: "${AUTORUN_LARAVEL_STORAGE_RECREATE:=false}"
14+
: "${AUTORUN_LARAVEL_STORAGE_RECREATE:=true}"
1615
: "${AUTORUN_LARAVEL_STORAGE_LINK:=true}"
1716

1817
# Set default values for optimizations
@@ -127,6 +126,15 @@ artisan_migrate() {
127126
fi
128127
}
129128

129+
artisan_setup_octane() {
130+
echo "🚀 Setup Laravel Octane: \"php artisan octane:install --server=$OCTANE_SERVER\"..."
131+
if ! php "$APP_BASE_DIR/artisan" octane:install --server=$OCTANE_SERVER; then
132+
echo "$script_name: Laravel Octane setup failed"
133+
return 1
134+
fi
135+
return 0
136+
}
137+
130138
artisan_storage_recreate() {
131139
storage_paths='storage/app/public storage/framework/cache/data storage/framework/sessions storage/framework/testings storage/framework/views storage/logs'
132140
for path in ${storage_paths}; do
@@ -419,6 +427,11 @@ if laravel_is_installed; then
419427
fi
420428

421429
echo "🤔 Checking for Laravel automations..."
430+
# If OCTANE_SERVER is set, run the Octane setup
431+
if [ -n "$OCTANE_SERVER" ]; then
432+
artisan_setup_octane
433+
fi
434+
422435
if [ "$AUTORUN_LARAVEL_STORAGE_RECREATE" = "true" ]; then
423436
artisan_storage_recreate
424437
fi

src/variations/frankenphp/etc/frankenphp/Caddyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import log-level/global/{$LOG_OUTPUT_LEVEL:info}.caddyfile
1616

1717
frankenphp {
18+
import worker/{$OCTANE_SERVER:off}.caddyfile
19+
1820
{$FRANKENPHP_CONFIG}
1921
}
2022

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# FrankenPHP worker configuration
2+
worker {
3+
file {$CADDY_APP_PUBLIC_PATH:/var/www/html/public}/frankenphp-worker.php
4+
{$FRANKENPHP_WORKER_CONFIG}
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Off mode worker configuration

0 commit comments

Comments
 (0)