Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve setup doc #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions docs/topics/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).*

Expand All @@ -16,25 +18,21 @@ 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
```

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.*