{"id":20555268,"url":"https://github.com/systemsdk/docker-apache-php-symfony","last_synced_at":"2025-04-05T10:08:59.647Z","repository":{"id":37034148,"uuid":"171686251","full_name":"systemsdk/docker-apache-php-symfony","owner":"systemsdk","description":"Docker environment required to run Symfony (based on official php and mysql docker hub repositories)","archived":false,"fork":false,"pushed_at":"2025-02-02T17:33:38.000Z","size":5704,"stargazers_count":60,"open_issues_count":0,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T09:11:37.097Z","etag":null,"topics":["apache","apache2","bitbucket-pipelines","circleci","cron","docker","github-actions","multi-environment","mysql","mysql8","php","php8","rabbitmq","ssl","supervisord","symfony","symfony7","ubuntu","xdebug"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemsdk.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=4ZZHRZHENRPZN"]}},"created_at":"2019-02-20T14:17:36.000Z","updated_at":"2025-02-16T18:52:27.000Z","dependencies_parsed_at":"2024-02-18T19:32:25.726Z","dependency_job_id":"1317ae62-8038-472e-8de4-3927e26cca38","html_url":"https://github.com/systemsdk/docker-apache-php-symfony","commit_stats":{"total_commits":51,"total_committers":3,"mean_commits":17.0,"dds":"0.47058823529411764","last_synced_commit":"2139ab94b2c23f5a1691da1657e97bedfad48dbe"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-apache-php-symfony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-apache-php-symfony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-apache-php-symfony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-apache-php-symfony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemsdk","download_url":"https://codeload.github.com/systemsdk/docker-apache-php-symfony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318745,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","apache2","bitbucket-pipelines","circleci","cron","docker","github-actions","multi-environment","mysql","mysql8","php","php8","rabbitmq","ssl","supervisord","symfony","symfony7","ubuntu","xdebug"],"created_at":"2024-11-16T03:17:30.395Z","updated_at":"2025-04-05T10:08:59.618Z","avatar_url":"https://github.com/systemsdk.png","language":"PHP","funding_links":["https://www.paypal.com/donate/?hosted_button_id=4ZZHRZHENRPZN"],"categories":[],"sub_categories":[],"readme":"# PHP symfony environment\nDocker environment required to run Symfony (based on official php and mysql docker hub repositories).\n\n[![Actions Status](https://github.com/systemsdk/docker-apache-php-symfony/workflows/Symfony%20App/badge.svg)](https://github.com/systemsdk/docker-apache-php-symfony/actions)\n[![CircleCI](https://circleci.com/gh/systemsdk/docker-apache-php-symfony.svg?style=svg)](https://circleci.com/gh/systemsdk/docker-apache-php-symfony)\n[![Coverage Status](https://coveralls.io/repos/github/systemsdk/docker-apache-php-symfony/badge.svg)](https://coveralls.io/github/systemsdk/docker-apache-php-symfony)\n[![Latest Stable Version](https://poser.pugx.org/systemsdk/docker-apache-php-symfony/v)](https://packagist.org/packages/systemsdk/docker-apache-php-symfony)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n[Source code](https://github.com/systemsdk/docker-apache-php-symfony.git)\n\n## Requirements\n* Docker Engine version 18.06 or later\n* Docker Compose version 1.22 or later\n* An editor or IDE\n* MySQL Workbench\n\nNote: OS recommendation - Linux Ubuntu based.\n\n## Components\n1. Apache 2.4\n2. PHP 8.4 (Apache handler)\n3. MySQL 8\n4. Symfony 7\n5. RabbitMQ 4\n6. Mailpit (only for debug emails on dev environment)\n\n## Setting up Docker Engine with Docker Compose\nFor installing Docker Engine with docker compose please follow steps mentioned on page [Docker Engine](https://docs.docker.com/engine/install/).\n\nNote 1: Please run next cmd after above step if you are using Linux OS: `sudo usermod -aG docker $USER`\n\nNote 2: If you are using Docker Desktop for MacOS 12.2 or later - please enable [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for performance (enabled by default since Docker Desktop v4.22).\n\n## Setting up DEV environment\n1.You can clone this repository from GitHub or install via composer.\n\nIf you have installed composer and want to install environment via composer you can use next cmd command:\n```bash\ncomposer create-project systemsdk/docker-apache-php-symfony example-app\n```\n\n2.Set another APP_SECRET for application in .env.prod and .env.staging files.\n\nNote 1: You can get unique secret key for example [here](http://nux.net/secret).\n\nNote 2: Do not use .env.local.php on dev and test environment (delete it if exist).\n\nNote 3: If you want to change default web port/xdebug configuration you can create .env.local file and set some params (see .env file).\n\nNote 4: Delete var/mysql-data folder if it exists.\n\n3.Add domain to local 'hosts' file:\n```bash\n127.0.0.1    localhost\n```\n\n4.Configure `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (MacOS) (optional):\n\n- In case you need debug only requests with IDE KEY: PHPSTORM from frontend in your browser:\n```bash\nxdebug.start_with_request = no\n```\nInstall locally in Firefox extension \"Xdebug helper\" and set in settings IDE KEY: PHPSTORM\n\n- In case you need debug any request to an api (by default):\n```bash\nxdebug.start_with_request = yes\n```\n\n5.Build, start and install the docker images from your terminal:\n```bash\nmake build\nmake start\nmake composer-install\n```\n\n6.Make sure that you have installed migrations / messenger transports:\n```bash\nmake migrate\nmake messenger-setup-transports\n```\n\n7.In order to use this application, please open in your browser next urls:\n- [http://localhost](http://localhost)\n- [http://localhost:15672 (RabbitMQ)](http://localhost:15672)\n- [http://localhost:8025 (Mailpit)](http://localhost:8025)\n\n## Setting up STAGING environment locally\n1.You can clone this repository from GitHub or install via composer.\n\nNote: Delete var/mysql-data folder if it is exist.\n\nIf you have installed composer and want to install environment via composer you can use next cmd command:\n```bash\ncomposer create-project systemsdk/docker-apache-php-symfony example-app\n```\n\n2.Build, start and install the docker images from your terminal:\n```bash\nmake build-staging\nmake start-staging\n```\n\n3.Make sure that you have installed migrations / messenger transports:\n```bash\nmake migrate-no-test\nmake messenger-setup-transports\n```\n\n## Setting up PROD environment locally\n1.You can clone this repository from GitHub or install via composer.\n\nIf you have installed composer and want to install environment via composer you can use next cmd command:\n```bash\ncomposer create-project systemsdk/docker-apache-php-symfony example-app\n```\n\n2.Edit compose-prod.yaml and set necessary user/password for MySQL and RabbitMQ.\n\nNote: Delete var/mysql-data folder if it is exist.\n\n3.Edit env.prod and set necessary user/password for MySQL and RabbitMQ.\n\n4.Build, start and install the docker images from your terminal:\n```bash\nmake build-prod\nmake start-prod\n```\n\n5.Make sure that you have installed migrations / messenger transports:\n```bash\nmake migrate-no-test\nmake messenger-setup-transports\n```\n\n## Getting shell to container\nAfter application will start (`make start`) and in order to get shell access inside symfony container you can run following command:\n```bash\nmake ssh\n```\nNote 1: Please use next make commands in order to enter in other containers: `make ssh-supervisord`, `make ssh-mysql`, `make ssh-rabbitmq`.\n\nNote 2: Please use `exit` command in order to return from container's shell to local shell.\n\n## Building containers\nIn case you edited Dockerfile or other environment configuration you'll need to build containers again using next commands:\n```bash\nmake down\nmake build\nmake start\n```\nNote: Please use environment-specific commands if you need to build test/staging/prod environment, more details can be found using help `make help`.\n\n## Start and stop environment containers\nPlease use next make commands in order to start and stop environment:\n```bash\nmake start\nmake stop\n```\nNote 1: For staging environment need to be used next make commands: `make start-staging`, `make stop-staging`.\n\nNote 2: For prod environment need to be used next make commands: `make start-prod`, `make stop-prod`.\n\n## Stop and remove environment containers, networks\nPlease use next make commands in order to stop and remove environment containers, networks:\n```bash\nmake down\n```\nNote: Please use environment-specific commands if you need to stop and remove test/staging/prod environment, more details can be found using help `make help`.\n\n## Additional main command available\n```bash\nmake build\nmake build-test\nmake build-staging\nmake build-prod\n\nmake start\nmake start-test\nmake start-staging\nmake start-prod\n\nmake stop\nmake stop-test\nmake stop-staging\nmake stop-prod\n\nmake down\nmake down-test\nmake down-staging\nmake down-prod\n\nmake restart\nmake restart-test\nmake restart-staging\nmake restart-prod\n\nmake env-staging\nmake env-prod\n\nmake ssh\nmake ssh-root\nmake fish\nmake ssh-supervisord\nmake ssh-mysql\nmake ssh-rabbitmq\n\nmake composer-install-no-dev\nmake composer-install\nmake composer-update\nmake composer-audit\n\nmake info\nmake help\n\nmake logs\nmake logs-supervisord\nmake logs-mysql\nmake logs-rabbitmq\n\nmake drop-migrate\nmake migrate\nmake migrate-no-test\n\nmake fixtures\n\nmake messenger-setup-transports\n\nmake phpunit\nmake report-code-coverage\n\nmake phpcs\nmake ecs\nmake ecs-fix\nmake phpmetrics\nmake phpcpd\nmake phpmd\nmake phpstan\nmake phpinsights\n\netc....\n```\nNotes: Please see more commands in Makefile\n\n## Architecture \u0026 packages\n* [Symfony](https://symfony.com)\n* [apache-pack](https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack)\n* [doctrine-migrations-bundle](https://github.com/doctrine/DoctrineMigrationsBundle)\n* [doctrine-fixtures-bundle](https://github.com/doctrine/DoctrineFixturesBundle)\n* [command-scheduler-bundle](https://packagist.org/packages/dukecity/command-scheduler-bundle)\n* [phpunit](https://github.com/sebastianbergmann/phpunit)\n* [phpunit-bridge](https://github.com/symfony/phpunit-bridge)\n* [browser-kit](https://github.com/symfony/browser-kit)\n* [css-selector](https://github.com/symfony/css-selector)\n* [security-checker](https://github.com/fabpot/local-php-security-checker)\n* [messenger](https://symfony.com/doc/current/messenger.html)\n* [composer-bin-plugin](https://github.com/bamarni/composer-bin-plugin)\n* [composer-normalize](https://github.com/ergebnis/composer-normalize)\n* [composer-unused](https://packagist.org/packages/icanhazstring/composer-unused)\n* [composer-require-checker](https://packagist.org/packages/maglnet/composer-require-checker)\n* [requirements-checker](https://github.com/symfony/requirements-checker)\n* [security-advisories](https://github.com/Roave/SecurityAdvisories)\n* [php-coveralls](https://github.com/php-coveralls/php-coveralls)\n* [easy-coding-standard](https://github.com/Symplify/EasyCodingStandard)\n* [PhpMetrics](https://github.com/phpmetrics/PhpMetrics)\n* [phpcpd](https://github.com/systemsdk/phpcpd)\n* [phpmd](https://packagist.org/packages/phpmd/phpmd)\n* [phpstan](https://packagist.org/packages/phpstan/phpstan)\n* [phpinsights](https://packagist.org/packages/nunomaduro/phpinsights)\n* [rector](https://packagist.org/packages/rector/rector)\n\n## Guidelines\n* [Commands](docs/commands.md)\n* [Development](docs/development.md)\n* [Testing](docs/testing.md)\n* [IDE PhpStorm configuration](docs/phpstorm.md)\n* [Xdebug configuration](docs/xdebug.md)\n* [Messenger component](docs/messenger.md)\n\n## Working on your project\n1. For new feature development, fork `develop` branch into a new branch with one of the two patterns:\n    * `feature/{ticketNo}`\n2. Commit often, and write descriptive commit messages, so its easier to follow steps taken when reviewing.\n3. Push this branch to the repo and create pull request into `develop` to get feedback, with the format `feature/{ticketNo}` - \"Short descriptive title of Jira task\".\n4. Iterate as needed.\n5. Make sure that \"All checks have passed\" on CircleCI(or another one in case you are not using CircleCI) and status is green.\n6. When PR is approved, it will be squashed \u0026 merged, into `develop` and later merged into `release/{No}` for deployment.\n\nNote: You can find git flow detail example [here](https://danielkummer.github.io/git-flow-cheatsheet).\n\n## License\n[The MIT License (MIT)](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsdk%2Fdocker-apache-php-symfony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemsdk%2Fdocker-apache-php-symfony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsdk%2Fdocker-apache-php-symfony/lists"}