Setting up the server should be quick and easy. These are the necessary steps:
- Download the project from Github (or
git clone https://github.com/moay/server-for-symfony-flex
) - Navigate to the project folder and run
composer install
. - Install Encore with
yarn install
(or withdocker run --rm --name=node --mount type=bind,source="$(pwd)"/,target=/app --workdir=/app node yarn yarn install
) - Build assets with
yarn encore dev
(or withdocker run --rm --name=node --mount type=bind,source="$(pwd)"/,target=/app --workdir=/app node yarn encore dev
) - Open the file
config/parameters.yaml
and enter the url to your private recipes repo (or provide appropriate environment variables). - Setup the
APP_ENV
properly. This can be done in the.env
file (create if needed) or on the hosting. Setting it toprod
is recommended. - 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).
That's it, you should be up and running. You might want to tweak the configuration or to setup automatic recipe updates.
Installing a monitoring tool (like Sentry) is recommended.
To enable recipes defined in your server, run the following command in your project:
composer config extra.symfony.endpoint https://your.domain.com
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) running the following command:
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.