From 23a38d881ac0e5cb9f4496c99303969bb1a77e10 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sun, 19 Sep 2021 10:32:11 -0700 Subject: [PATCH 1/3] Add docs about applications with Symfony Runtime --- docs/frameworks/symfony-runtime.md | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/frameworks/symfony-runtime.md diff --git a/docs/frameworks/symfony-runtime.md b/docs/frameworks/symfony-runtime.md new file mode 100644 index 000000000..a8a33861a --- /dev/null +++ b/docs/frameworks/symfony-runtime.md @@ -0,0 +1,48 @@ +--- +title: Serverless applications with Symfony Runtime +current_menu: symfony-runtime +introduction: Learn how to deploy serverless applications on AWS Lambda using Bref and Symfony Runtime component. +--- + +The Symfony Runtime runtime component was release with Symfony 5.3. All new Symfony +applications are using that component as default, but the component can also be +used with non-Symfony applications. + +This guide helps you run any PHP applications on AWS Lambda using Bref and the Symfony +Runtime component. + +## Setup + +First, **follow the [Installation guide](../installation.md)** to create an AWS +account and install the necessary tools. + +Next, in an any project using the [Symfony Runtime](https://symfony.com/doc/current/components/runtime.html), +install the Bref Runtime package. + +``` +composer require runtime/bref +``` + +If you are using [Symfony Flex](https://flex.symfony.com/), it will automatically run +the [runtime/bref recipe](https://github.com/symfony/recipes/tree/master/runtime/bref/0.2) +which will perform the following tasks: + +- Create a `serverless.yml` configuration file. +- Add the `.serverless` folder to the `.gitignore` file. +- Add a `bootstrap` file in the project root. + +> Otherwise, you can create the files yourself at the root of your project. +Take a look at the [serverless.yml](https://github.com/symfony/recipes/tree/master/runtime/bref/0.2/serverless.yaml) +and [bootstrap](https://github.com/symfony/recipes/tree/master/runtime/bref/0.2/bootstrap) +provided by the recipe. + +You may still have a few modifications to do make your application compatible +with AWS Lambda. Since [the filesystem is readonly](/docs/environment/storage.md) +except for `/tmp` we need to customize where to store the cache, logs etc. + +Take a look at the [Laravel](laravel.md) or [Symfony](symfony.md) setup guides how +they solve the problem. + +## Deploy + +The application is now ready to be deployed. Follow [the deployment guide](/docs/deploy.md). From 71dea3acdee8829ce33f0579315a4a44d3cdf1c4 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sun, 19 Sep 2021 16:12:47 -0700 Subject: [PATCH 2/3] Added link in sidebar --- couscous.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/couscous.yml b/couscous.yml index 11cf8276b..e00da8ac7 100644 --- a/couscous.yml +++ b/couscous.yml @@ -68,6 +68,10 @@ menu: text: Symfony url: /docs/frameworks/symfony.html title: Learn how to deploy serverless Symfony applications + symfony-runtime: + text: Symfony Runtime + url: /docs/frameworks/symfony-runtime.html + title: Learn how to deploy serverless application prowed by the Runtime component functions: - section: 'Bref for event-driven functions' From d80bb2a9dd2bd77e22ab36c38ae13353c90f5239 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 20 Sep 2021 10:17:27 -0700 Subject: [PATCH 3/3] Update docs/frameworks/symfony-runtime.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien HOUZÉ --- docs/frameworks/symfony-runtime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/frameworks/symfony-runtime.md b/docs/frameworks/symfony-runtime.md index a8a33861a..eb158c905 100644 --- a/docs/frameworks/symfony-runtime.md +++ b/docs/frameworks/symfony-runtime.md @@ -4,7 +4,7 @@ current_menu: symfony-runtime introduction: Learn how to deploy serverless applications on AWS Lambda using Bref and Symfony Runtime component. --- -The Symfony Runtime runtime component was release with Symfony 5.3. All new Symfony +The Symfony Runtime component was released with Symfony 5.3. All new Symfony applications are using that component as default, but the component can also be used with non-Symfony applications.