From cb28573ac4a7ab248e844f2663da75e20dce2264 Mon Sep 17 00:00:00 2001 From: Mathias STRASSER Date: Mon, 20 Jul 2020 18:27:55 +0200 Subject: [PATCH 1/3] Add missing webpack js installation --- docs/topics/setup.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/topics/setup.md b/docs/topics/setup.md index 1fbff5f..05d4524 100644 --- a/docs/topics/setup.md +++ b/docs/topics/setup.md @@ -4,9 +4,11 @@ Setting up the server should be quick and easy. These are the necessary steps: 1. [Download](https://github.com/moay/server-for-symfony-flex/releases) the project from Github (or `git clone https://github.com/moay/server-for-symfony-flex`) 2. Navigate to the project folder and run `composer install`. -3. Open the file `config/parameters.yaml` and enter the url to your private recipes repo (or provide appropriate environment variables). -4. Setup the `APP_ENV` properly. This can be done in the `.env` file (create if needed) or on the hosting. Setting it to `prod` is recommended. -5. Run `php bin/console recipes:initialize` in order to download your recipes. +3. Install Encore with `yarn install` (or with `docker run --rm --name=node --mount type=bind,source="$(pwd)"/,target=/app --workdir=/app node yarn yarn install`) +4. Build assets with `yarn encore dev` (or with `docker run --rm --name=node --mount type=bind,source="$(pwd)"/,target=/app --workdir=/app node yarn encore dev`) +5. Open the file `config/parameters.yaml` and enter the url to your private recipes repo (or provide appropriate environment variables). +6. Setup the `APP_ENV` properly. This can be done in the `.env` file (create if needed) or on the hosting. Setting it to `prod` is recommended. +7. Run `php bin/console recipes:initialize` in order to download your recipes. *Of course, you should deploy the project to where it will be hosted (probably before step 2).* From b60577d04dc4d1e7f2bbce172f702a9c3480141d Mon Sep 17 00:00:00 2001 From: Mathias STRASSER Date: Mon, 20 Jul 2020 18:31:35 +0200 Subject: [PATCH 2/3] Prefer to use composer command instead of yaml example --- docs/topics/setup.md | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/docs/topics/setup.md b/docs/topics/setup.md index 05d4524..24375be 100644 --- a/docs/topics/setup.md +++ b/docs/topics/setup.md @@ -18,25 +18,19 @@ Installing a monitoring tool (like [Sentry](https://sentry.io)) is recommended. ### Using the server -Using the server in your Symfony project is as easy as adding the proper endpoint to your `composer.json`: +To enable recipes defined in your server, run the following command in your project: - { - ... - "symfony": { - "endpoint": "https://your.domain.com" - } - } +```sh +composer config extra.symfony.endpoint https://your.domain.com +``` #### Running the server locally Running the server locally is possible by using symfony's server command: `php bin/console server:start` (oder `server:run` for a temporary instance). -Make sure to allow connections over http to composer (if using localhost) by adding this to the project's `composer.json`: - - { - ... - "config": { - "secure-http": false - } - } - +Make sure to allow connections over http to composer (if using localhost) running the following command: + +```sh +composer config secure-http false +``` + *It is not recommended to run the server locally. The best setup would be a private server behind a firewall.* From 69928d4361fec094d0f6bd1af932d1cc255f8523 Mon Sep 17 00:00:00 2001 From: Mathias STRASSER Date: Wed, 14 Oct 2020 11:52:45 +0200 Subject: [PATCH 3/3] Add reminder about the built-in Symfony server See: https://github.com/moay/server-for-symfony-flex/pull/58#issuecomment-687080675 --- docs/topics/setup.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/topics/setup.md b/docs/topics/setup.md index 24375be..c38402a 100644 --- a/docs/topics/setup.md +++ b/docs/topics/setup.md @@ -33,4 +33,6 @@ Make sure to allow connections over http to composer (if using localhost) runnin composer config secure-http false ``` +Reminder: The built-in Symfony server is only available when `APP_ENV` is set to `dev`. + *It is not recommended to run the server locally. The best setup would be a private server behind a firewall.*