From f5393dfbba673e172e2fcc10c2285e9ce9bf9a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=C5=A1ek=20Henzl?= Date: Fri, 16 Jul 2021 02:44:24 +1200 Subject: [PATCH] [Bref] Clarify serverless configuration for Symfony (#65) --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 11f10a4..faa93e2 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ composer require bref/extra-php-extensions ### Symfony application -Use the standard Symfony 5.3+ index.php. +Use the standard Symfony 5.3+ `public/index.php`. ```php // public/index.php @@ -78,6 +78,22 @@ return function (array $context) { }; ``` +```diff + # serverless.yml + + functions: + web: + handler: public/index.php + timeout: 28 + layers: +- - ${bref:layer.php-80-fpm} ++ - ${bref:layer.php-80} ++ - ${bref-extra:symfony-runtime-php-80} + events: + - httpApi: '*' +``` + + ### PSR-15 application ```php @@ -133,7 +149,7 @@ to serverless.yml ### Console application -Use the standard Symfony 5.3+ bin/console. +Use the standard Symfony 5.3+ `bin/console`. ```php // bin/console @@ -154,7 +170,11 @@ return function (array $context) { # serverless.yml functions: - app: -- handler: public/index.php -+ handler: bin/console + console: + handler: bin/console + timeout: 120 + layers: + - ${bref:layer.php-80} +- - ${bref:layer.console} ++ - ${bref-extra:symfony-runtime-php-80} ```