Symfony blog project. Full documentation for the project is available here
This project was setup using dunglas/symfony-docker
- If not already done, install Docker Compose
- Run
docker-compose build --pull --no-cache
to build fresh images - Run
docker-compose up
(the logs will be displayed in the current shell) - Open
https://localhost
in your favorite web browser and accept the auto-generated TLS certificate - Run
docker-compose down --remove-orphans
to stop the Docker containers.
Open a shell inside the Node.js container and run the following commands to install & build web assets :
yarn install
yarn build
Open a shell inside the NPHP container and run the following commands to load the inital data set :
php bin/console doctrine:fixtures:load --append
- Production, development and CI ready
- Automatic HTTPS (in dev and in prod!)
- HTTP/2, HTTP/3 and Preload support
- Built-in Mercure hub
- Vulcain support
- PHP FPM and Caddy server
If you would like to install this project on your computer, you will first need to clone the repo of this project using Git.
At the root of your projet, you need to create a .env.local file (same level as .env) in which you need to configure the appropriate values for your blog to run. Specifically, you need to override the following variables :
DATABASE_URL="mysql://root:password@localhost:3306/snowtricks"
[email protected]
ADMIN_PASSWORD=ChooseAStrongPersonalPasswordHere
ADMIN_USERNAME=youradminusername
- PHP 8.1.4 or above
- yarn & Node.js
- composer
- Download the Symfony CLI.
- Run this command will guide you in cases there are missing extensions or parameters you need to tweek on your machine
symfony check:requirements
Before running the project, you need to run the following commands in order to install the appropriate dependencies.
composer install
Now let's create our database. This will use the DATABASE_URL you've provided in .env.local file.
php bin/console doctrine:database:create
php bin/console doctrine:schema:update --force
php bin/console doctrine:fixtures:load --append
yarn install
yarn build
Now you should be ready to launch the dev webserver using
symfony serve
The symfony serve
command will start a PHP webserver.
You can now go to your localhost URL : http://127.0.0.1:8000 where the blog should be displayed.
NB: alternatively, if you do not wish to use the Symfony webserver, you can always use WAMP / Laragon / MAMP or a similar webserver suite.
Created by Estelle Gaits as the sixth project of the Openclassrooms PHP / Symfony Apps Developer training course.