Skip to content

Commit 6dae8ab

Browse files
committed
Update frankenphp files
1 parent 544c972 commit 6dae8ab

File tree

6 files changed

+29
-10
lines changed

6 files changed

+29
-10
lines changed

frankenphp/Caddyfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
{$SERVER_NAME:localhost} {
1212
log {
13+
{$CADDY_SERVER_LOG_OPTIONS}
1314
# Redact the authorization query parameter that can be set by Mercure
1415
format filter {
1516
request>uri query {
@@ -18,7 +19,7 @@
1819
}
1920
}
2021

21-
root * /app/public
22+
root /app/public
2223
encode zstd br gzip
2324

2425
mercure {
@@ -43,5 +44,16 @@
4344
# Disable Topics tracking if not enabled explicitly: https://github.com/jkarlin/topics
4445
header ?Permissions-Policy "browsing-topics=()"
4546

46-
php_server
47+
@phpRoute {
48+
not path /.well-known/mercure*
49+
not file {path}
50+
}
51+
rewrite @phpRoute index.php
52+
53+
@frontController path index.php
54+
php @frontController
55+
56+
file_server {
57+
hide *.php
58+
}
4759
}

frankenphp/conf.d/app.ini renamed to frankenphp/conf.d/10-app.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ expose_php = 0
22
date.timezone = UTC
33
apc.enable_cli = 1
44
session.use_strict_mode = 1
5-
upload_max_filesize = 16M
6-
post_max_size = 32M
75
zend.detect_unicode = 0
86

97
; https://symfony.com/doc/current/performance.html
File renamed without changes.

frankenphp/conf.d/20-app.prod.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
; https://symfony.com/doc/current/performance.html#use-the-opcache-class-preloading
2+
opcache.preload_user = root
3+
opcache.preload = /app/config/preload.php
4+
; https://symfony.com/doc/current/performance.html#don-t-check-php-files-timestamps
5+
opcache.validate_timestamps = 0

frankenphp/conf.d/app.prod.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

frankenphp/docker-entrypoint.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
1717
composer config --json extra.symfony.docker 'true'
1818

1919
if grep -q ^DATABASE_URL= .env; then
20-
echo "To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait"
20+
echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait'
2121
sleep infinity
2222
fi
2323
fi
@@ -26,8 +26,12 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
2626
composer install --prefer-dist --no-progress --no-interaction
2727
fi
2828

29+
# Display information about the current project
30+
# Or about an error in project initialization
31+
php bin/console -V
32+
2933
if grep -q ^DATABASE_URL= .env; then
30-
echo "Waiting for database to be ready..."
34+
echo 'Waiting for database to be ready...'
3135
ATTEMPTS_LEFT_TO_REACH_DATABASE=60
3236
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(php bin/console dbal:run-sql -q "SELECT 1" 2>&1); do
3337
if [ $? -eq 255 ]; then
@@ -41,11 +45,11 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
4145
done
4246

4347
if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then
44-
echo "The database is not up or not reachable:"
48+
echo 'The database is not up or not reachable:'
4549
echo "$DATABASE_ERROR"
4650
exit 1
4751
else
48-
echo "The database is now ready and reachable"
52+
echo 'The database is now ready and reachable'
4953
fi
5054

5155
if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then
@@ -55,6 +59,8 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
5559

5660
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
5761
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
62+
63+
echo 'PHP app ready!'
5864
fi
5965

6066
exec docker-php-entrypoint "$@"

0 commit comments

Comments
 (0)