This project is a boilerplate for setting up a Symfony application using Docker and Makefile. It includes services for PHP-FPM and Nginx, providing an isolated development environment.
- Symfony 7.0 skeleton installation.
- PHP-FPM container for executing PHP.
- Nginx container for serving the application.
- Easy-to-use
Makefile
for common tasks (building, starting, stopping, and clearing cache). - Docker Compose configuration for containerized setup.
- PHPCS: Code style enforcement.
- PHPStan: Static code analysis for finding bugs.
- PHPUnit: Unit testing framework.
- Clone this repository:
git clone <repository-url>
cd <repository-directory>
- Initialize the Symfony project:
make init
The application will be available at: http://127.0.0.1:8080/.
Your Symfony application will be available under the app folder.
Command | Description |
---|---|
make init |
Initialize a new Symfony project |
make cc |
Clear the Symfony cache |
Command | Description |
---|---|
make composer-install |
Install composer dependencies |
make composer-update |
Update composer dependencies |
make composer-clear-cache |
Clear composer cache |
Command | Description |
---|---|
make build |
Build Docker images |
make rebuild |
Rebuild services and volumes |
make start |
Start Docker containers |
make stop |
Stop Docker containers |
make prune |
Remove unused Docker volumes |
make logs |
Display container logs |
make exec-php-fpm |
Open bash in PHP-FPM container |
make exec-nginx |
Open shell in Nginx container |
Command | Description |
---|---|
make phpcs |
Check code style based on PSR-12 |
make phpcbf |
Fix coding style issues based on PSR-12 |
make phpstan |
Analyze code for bugs and errors |
make phpunit |
Run unit tests |
Command | Description |
---|---|
make help |
List all available commands |
- Built from the ./docker/php-fpm context.
- Customizable through USER_UID, USER_GID, and TIMEZONE build arguments.
- Mounts:
- ./app to /var/www (Symfony application).
- ./docker/php-fpm/logs/ to /var/log.
- Based on nginx:alpine.
- Serves the application on http://127.0.0.1:8080/.
- Mounts:
- ./app to /var/www (Symfony application).
- /docker/nginx/nginx.conf to /etc/nginx/conf.d/default.conf.
- /docker/nginx/logs/ to /var/log/nginx.
- Modify ./docker/nginx/nginx.conf to customize the Nginx configuration.
- Adjust ./docker/php-fpm/Dockerfile for PHP-FPM customizations.
- Update .env to configure variables like USER_UID, USER_GID, and TIMEZONE.
To customize the Symfony version, you must modify the base PHP-FPM image with the right version and adjust the Makefile to use the appropriate Symfony skeleton for project creation.
This project is licensed under the MIT License.
I welcome feedback, suggestions, and contributions to help improve this project! If you have an idea for a new feature, found a bug, or have any other feedback, feel free to create an issue.
-
Propose Enhancements:
Have an idea to improve the project? Open a new issue and describe your suggestion in detail.
👉 Create an enhancement issue -
Report Bugs:
Encountered a bug? Let us know by creating a bug report issue.
👉 Create a bug report issue -
Ask Questions or Request Features:
If you're unsure about something or want a specific feature, open a general issue.
👉 Create a general issue
- Provide as much detail as possible to help us understand your request.
- Be respectful and constructive in your communication.