Download the PHP package systemsdk/docker-nginx-php-symfony without Composer
On this page you can find all versions of the php package systemsdk/docker-nginx-php-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download systemsdk/docker-nginx-php-symfony
More information about systemsdk/docker-nginx-php-symfony
Files in systemsdk/docker-nginx-php-symfony
Package docker-nginx-php-symfony
Short Description Docker symfony environment
License MIT
Homepage https://github.com/systemsdk/docker-nginx-php-symfony
Informations about the package docker-nginx-php-symfony
PHP Symfony Environment
A scalable Docker-based environment required to run Symfony (based on official php and mysql docker hub repositories).
Requirements
- Docker Engine version 23.0 or later
- Docker Compose version 2.0 or later
- An editor or IDE
- MySQL Workbench
Note: We recommend using a Linux Ubuntu-based OS for the best experience.
Components
- Nginx 1.29 - Web server and reverse proxy.
- PHP 8.5 fpm - Main application runtime.
- MySQL 8 - Primary relational database.
- Symfony 7 - High-performance PHP framework.
- RabbitMQ 4 - Robust message broker for background jobs.
- Mailpit - Email testing tool (available in the development environment only).
Setting up Docker Engine & Docker Compose
To install Docker Engine and Docker Compose, please follow the official Docker Engine Installation Guide.
For Linux Users:
After installation, run the following command to manage Docker as a non-root user (this allows you to run Docker without sudo):
Note: You must log out and log back in for this change to take effect.
For macOS Users: If you are using Docker Desktop for macOS 12.2 or later, we highly recommend enabling virtiofs for a significant performance boost.
Note: Enabled by default since Docker Desktop v4.22.
Setting up the DEV environment
-
You can clone this repository from GitHub or install via composer.
If you have installed composer, you can use the next cmd command:
-
Set a unique
APP_SECRETfor the application in.env.prodand.env.stagingfiles.- Secret Key: You can generate a secure key by running:
openssl rand -hex 16(do not use third-party websites for generating this value). - Environment Files: Do not use
.env.local.phpon dev and test environments (delete it if it exists). - Custom Configs: If you want to change default web port/xdebug configurations, you can create an
.env.localfile and override parameters there (see.envfile). - Database: Delete the
var/mysql-datafolder if it exists before starting.
- Secret Key: You can generate a secure key by running:
-
Verify that your local
hostsfile contains the default mapping forlocalhost(this is usually set by default in all operating systems):Note: The file is located at
/etc/hostson Linux/macOS andC:\Windows\System32\drivers\etc\hostson Windows. -
Configure Xdebug (Optional)
Depending on your operating system, you can customize Xdebug behavior by editing either
/docker/dev/xdebug-main.ini(Linux/Windows) or/docker/dev/xdebug-osx.ini(macOS).-
To debug every request (Default):
This is the default setting. It will intercept and debug all incoming API requests.
-
To debug only specific requests (On-Demand):
If you prefer to trigger the debugger manually only when making requests from a browser frontend, change the configuration to:
Tip: Install the "Xdebug helper" extension for Chrome or Firefox and set the IDE Key to
PHPSTORMin the extension settings.
-
-
Build and Initialize the Environment
Run the following commands in your terminal to build the Docker images, start the containers, install PHP dependencies:
-
Apply Migrations and Configurations
Execute the following commands to set up the database structure, prepare message broker transports:
-
Access Application Services
Once the environment is successfully running, you can access the various services in your browser using the following URLs:
- DEV page: http://localhost
- RabbitMQ Management: http://localhost:15672
- Mailpit (Debug Email): http://localhost:8025
Setting up the STAGING environment locally
Important: This section describes how to set up the staging environment locally for debugging and verification purposes only. A real STAGING environment must be deployed on a dedicated server and should be as close to the PRODUCTION environment as possible.
Note: These steps assume you have already completed steps 1 through 3 of the "Setting up the DEV environment" section above.
-
Database Clean-up
Delete the
var/mysql-datafolder if it exists before starting. -
Build and Initialize the Environment
Run the following commands in your terminal to build the staging Docker images, start the containers:
Note: With
opcache.validate_timestamps=0(php.ini) enabled for performance, any manual file changes or code updates require a PHP-FPM restart/reload to take effect. -
Apply Migrations and Configurations
Execute the following commands to set up the database structure, prepare message broker transports:
Setting up the PROD environment locally
Important: This section describes how to set up the production environment locally for debugging and verification purposes only. A real PROD environment must be deployed on a dedicated server.
Note: These steps assume you have already completed steps 1 through 3 of the "Setting up the DEV environment" section above.
-
Database and RabbitMQ Clean-up
Delete the
var/mysql-data,var/rabbitmqfolders if they exist before starting. -
Edit the
.env.prodfile and set a secure password for MySQL, as well as a username and password for RabbitMQ. -
Build and Initialize the Environment
Run the following commands in your terminal to build the production Docker images, start the containers:
Note: With
opcache.validate_timestamps=0(php.ini) enabled for performance, any manual file changes or code updates require a PHP-FPM restart/reload to take effect. -
Apply Migrations and Configurations
Execute the following commands to set up the database structure, prepare message broker transports:
Accessing Container Shells
Once the application is running (via make start), you can easily access the command line inside your containers.
To open a shell inside the main Symfony container, run:
You can also access the other services using the following commands:
Tip: Type exit and press Enter to leave the container's shell and return to your local terminal.
Rebuilding Containers
If you modify any Dockerfile or environment configurations, you will need to rebuild the containers using the following commands:
Note: Use environment-specific commands if you need to rebuild the test, staging, or production environments. For a complete list of available commands, run make help.
Starting and Stopping Containers
Use the following commands to start or stop the development environment:
If you are working with the staging or production environments, use their respective commands:
- Staging:
make start-stagingormake stop-staging. - Production:
make start-prodormake stop-prod.
Stopping and Removing Containers
To completely stop and remove all environment containers and networks, use the following command:
Note: Use environment-specific commands if you need to tear down the test, staging, or production environments. For a complete list of available commands, run make help.
Available Makefile Commands
Here is a reference list of the primary commands available for managing the environment, databases, logs and testing:
Note: For a complete list of all available commands, please inspect the Makefile directly or run make help.
Architecture & packages
- Symfony
- doctrine-migrations-bundle
- doctrine-fixtures-bundle
- command-scheduler-bundle
- phpunit
- phpunit-bridge
- browser-kit
- css-selector
- security-checker
- messenger
- composer-bin-plugin
- composer-normalize
- composer-unused
- composer-require-checker
- requirements-checker
- security-advisories
- php-coveralls
- easy-coding-standard
- PhpMetrics
- phpcpd
- phpmd
- phpstan
- phpinsights
- rector
Guidelines
- Commands
- Development
- IDE PhpStorm Configuration
- Xdebug Configuration
- Messenger Component
- Code Quality Tools
- Testing
Development Workflow
- Branching: Create a new branch from
developusing one of the following patterns:feature/{ticketNo}bugfix/{ticketNo}
- Commits: Commit frequently and write clear, descriptive commit messages to facilitate the review process.
- Pull Request: Push your branch to the repository and open a Pull Request (PR) against the
developbranch. Use the following naming convention for your PR:feature/{ticketNo} - Short descriptive title of the Jira task. - Review: Address any feedback from reviewers and iterate as needed.
- CI/CD Checks: Ensure that all continuous integration checks (e.g., CircleCI) pass successfully and the build status is green.
- Merge: Once approved, your PR will be squashed and merged into
develop. It will later be merged into arelease/{version}branch for deployment.
Note: For a detailed visual guide on this branching model, please refer to the Git Flow Cheatsheet.
License
The MIT License (MIT)
All versions of docker-nginx-php-symfony with dependencies
ext-amqp Version *
ext-ctype Version *
ext-iconv Version *
ext-json Version *
ext-mbstring Version *
ext-hash Version *
ext-openssl Version *
ext-pdo Version *
ext-pdo_mysql Version *
doctrine/doctrine-bundle Version 3.2.*
doctrine/doctrine-migrations-bundle Version 4.0.*
doctrine/orm Version 3.6.*
friendsofphp/proxy-manager-lts Version ^1.0.19
phpdocumentor/reflection-docblock Version ^6.0.3
dukecity/command-scheduler-bundle Version 6.0.*
symfony/amqp-messenger Version 7.4.*
symfony/asset Version 7.4.*
symfony/asset-mapper Version 7.4.*
symfony/config Version 7.4.*
symfony/console Version 7.4.*
symfony/doctrine-bridge Version 7.4.*
symfony/doctrine-messenger Version 7.4.*
symfony/dotenv Version 7.4.*
symfony/expression-language Version 7.4.*
symfony/flex Version ^2.11.0
symfony/form Version 7.4.*
symfony/framework-bundle Version 7.4.*
symfony/http-client Version 7.4.*
symfony/intl Version 7.4.*
symfony/mailer Version 7.4.*
symfony/messenger Version 7.4.*
symfony/mime Version 7.4.*
symfony/monolog-bundle Version ^4.0.2
symfony/notifier Version 7.4.*
symfony/process Version 7.4.*
symfony/property-access Version 7.4.*
symfony/property-info Version 7.4.*
symfony/runtime Version 7.4.*
symfony/routing Version 7.4.*
symfony/security-bundle Version 7.4.*
symfony/serializer Version 7.4.*
symfony/stimulus-bundle Version ^2.36.0
symfony/string Version 7.4.*
symfony/translation Version 7.4.*
symfony/twig-bundle Version 7.4.*
symfony/ux-turbo Version ^2.36.0
symfony/validator Version 7.4.*
symfony/web-link Version 7.4.*
symfony/yaml Version 7.4.*
twig/extra-bundle Version ^2.12|^3.24.0
twig/twig Version ^2.12|^3.28.0