Skip to content

Commit

Permalink
Merge pull request #23 from fly-apps/include_setting_proxy_laravel11_…
Browse files Browse the repository at this point in the history
…syntax

Include  Laravel 11 syntax for Trusting all Proxies  in the Dockerfile
  • Loading branch information
KTanAug21 authored Mar 21, 2024
2 parents e044ab7 + e4b73e9 commit 21ebf73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Binary file modified builds/dockerfile-laravel
Binary file not shown.
11 changes: 7 additions & 4 deletions resources/views/dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
&& mkdir -p storage/logs \
&& php artisan optimize:clear \
&& chown -R www-data:www-data /var/www/html \
&& sed -i 's/protected \$proxies/protected \$proxies = "*"/g' app/Http/Middleware/TrustProxies.php \
&& echo "MAILTO=\"\"\n* * * * * www-data /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel; \
if [ -d .fly ]; then cp .fly/entrypoint.sh /entrypoint; chmod +x /entrypoint; fi;
&& echo "MAILTO=\"\"\n* * * * * www-data /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \
@if( preg_match("~\^|^1[1-9]~", $laravel_version ) )&& sed -i='' '/->withMiddleware(function (Middleware \$middleware) {/a\
\$middleware->trustProxies(at: "*");\
' bootstrap/app.php; \
@else&& sed -i 's/protected \$proxies/protected \$proxies = "*"/g' app/Http/Middleware/TrustProxies.php;\ @endif
if [ -d .fly ]; then cp .fly/entrypoint.sh /entrypoint; chmod +x /entrypoint; fi;

@if(in_array($octane, ['frankenphp', 'roadrunner', 'swoole']))
@include('octane-'.$octane)
Expand Down Expand Up @@ -75,4 +78,4 @@
&& chown -R www-data:www-data /var/www/html/public
@endif

EXPOSE 8080
EXPOSE 8080

0 comments on commit 21ebf73

Please sign in to comment.