Caker is a Symfony development stack with the following docker configuration:
- Caddy v2 as a web server and reverse-proxy
- A PostgreSQL database
- A PHP (8.0.*) container based on the thecodingmachine PHP image with these additionnal plugins enabled:
- pgsql
- pdo_pgsql
- intl
- gd
For the Symfony environment, here is the configuration :
- PHP 8.0.* (with unlimited PHP memory)
- Symfony 5.2.*
- PHPUnit 9.5.*
- PHPStan (on level 5) with the following packages:
- extension-installer
- phpstan-doctrine
- phpstan-phpunit
- phpstan-symfony
- ECS (easy-coding-standard) which include PHPCS and PHP CS Fixer with the following rules:
- CLEAN_CODE
- PSR-12
- DOCTRINE_ANNOTATIONS
Before the first run, you must create a .env
file at the root of the project (you can copy paste the .env.dist
file and rename it) and fill the requested values.
To launch the stack, you only need to enter the following command in the folder in your terminal:
docker-compose -f ./docker-compose.yml up -d
To stop it, you can simply run the appropriate command:
docker-compose -f ./docker-compose.yml stop
Several commands have been preconfigured on the PHP container:
sf
replacephp bin/console
(the symfony console command)phpunit
replacephp vendor/bin/simple-phpunit
As stated above, a full suite of coding standards (CLEAN_CODE, PSR-12, DOCTRINE_ANNOTATIONS) has been configured in the PHP container. To use them you have the following commands:
phpstan analyse
ecs check
to check the coding standards errorsecs check --fix
to fix the errors above
This is a list of extensions that works very well with this stack:
- indent-rainbow
- Bracket Pair Colorizer 2
- Better Comments
- PHP Intelephense
- Code Spell Checker
- PHP DocBlocker
- PHP Namespace Resolver
- Path Intellisense
- Add Github Actions support