{"id":13563637,"url":"https://github.com/systemsdk/docker-nginx-php-laravel","last_synced_at":"2025-04-14T09:02:50.220Z","repository":{"id":37031111,"uuid":"171052548","full_name":"systemsdk/docker-nginx-php-laravel","owner":"systemsdk","description":"Docker environment required to run Laravel (based on official php and mysql docker hub repositories)","archived":false,"fork":false,"pushed_at":"2025-01-12T16:45:22.000Z","size":5587,"stargazers_count":340,"open_issues_count":0,"forks_count":125,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-07T02:11:36.233Z","etag":null,"topics":["bitbucket-pipelines","circleci","cron","docker","github-actions","laravel","laravel11","multi-environment","mysql","mysql8","nginx","php","php8","ssl","supervisord","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-16T21:11:55.000Z","updated_at":"2025-03-21T12:52:07.000Z","dependencies_parsed_at":"2024-01-14T03:47:31.782Z","dependency_job_id":"1baf46a8-b912-4212-b2a9-1b82c4e6be26","html_url":"https://github.com/systemsdk/docker-nginx-php-laravel","commit_stats":{"total_commits":43,"total_committers":3,"mean_commits":"14.333333333333334","dds":0.4418604651162791,"last_synced_commit":"29422f58034f264f91718b0df1fe0ef1768db3ec"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-nginx-php-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-nginx-php-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-nginx-php-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fdocker-nginx-php-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemsdk","download_url":"https://codeload.github.com/systemsdk/docker-nginx-php-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852131,"owners_count":21171840,"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":["bitbucket-pipelines","circleci","cron","docker","github-actions","laravel","laravel11","multi-environment","mysql","mysql8","nginx","php","php8","ssl","supervisord","ubuntu","xdebug"],"created_at":"2024-08-01T13:01:21.627Z","updated_at":"2025-04-14T09:02:50.189Z","avatar_url":"https://github.com/systemsdk.png","language":"PHP","funding_links":["https://www.paypal.com/donate/?hosted_button_id=4ZZHRZHENRPZN"],"categories":["PHP"],"sub_categories":[],"readme":"# PHP Laravel environment\nDocker environment required to run Laravel (based on official php and mysql docker hub repositories).\n\n[![Actions Status](https://github.com/systemsdk/docker-nginx-php-laravel/workflows/Laravel%20App/badge.svg)](https://github.com/systemsdk/docker-nginx-php-laravel/actions)\n[![CircleCI](https://circleci.com/gh/systemsdk/docker-nginx-php-laravel.svg?style=svg)](https://circleci.com/gh/systemsdk/docker-nginx-php-laravel)\n[![Coverage Status](https://coveralls.io/repos/github/systemsdk/docker-nginx-php-laravel/badge.svg)](https://coveralls.io/github/systemsdk/docker-nginx-php-laravel)\n[![Latest Stable Version](https://poser.pugx.org/systemsdk/docker-nginx-php-laravel/v)](https://packagist.org/packages/systemsdk/docker-nginx-php-laravel)\n[![Total Downloads](https://poser.pugx.org/systemsdk/docker-nginx-php-laravel/downloads)](https://packagist.org/packages/systemsdk/docker-nginx-php-laravel)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n[Source code](https://github.com/systemsdk/docker-nginx-php-laravel.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. Nginx 1.27\n2. PHP 8.4 fpm\n3. MySQL 8\n4. Laravel 11\n5. 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\nNote: Delete `storage/mysql-data` folder if it is exists.\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-nginx-php-laravel example-app\n```\n\n2.Add domain to local `hosts` file:\n```bash\n127.0.0.1    localhost\n```\n\n3.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\n4.Build, start and install the docker images from your terminal:\n```bash\nmake build\nmake start\nmake composer-install\nmake env-dev\n```\nNote 1: If you want to change default docker configurations (web_port, etc...) - open `.env` file, edit necessary environment variable value and stop, rebuild, start docker containers.\n\nNote 2: If you are changing `.env` file and such env params like `MYSQL_VERSION`, `MYSQL_ROOT_PASSWORD`, don't forget to stop docker containers and delete `storage/mysql-data` folder before rebuild docker images.\n\n5.Make sure that you have installed migrations/seeds:\n```bash\nmake migrate\nmake seed\n```\n\n6.Set key for application:\n```bash\nmake key-generate\n```\n\n7.In order to use this application, please open in your browser next urls:\n- [http://localhost](http://localhost)\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 `storage/mysql-data` and `vendor` folder if it is exists.\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-nginx-php-laravel example-app\n```\nNote: If you want to change default docker configurations (web_port, etc...) - create uncommitted `.env` file, copy data from `.env.staging`, edit necessary environment variable value.\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:\n```bash\nmake migrate-no-test\n```\n\n4.Set key for application:\n```bash\nmake key-generate\n```\n\n## Setting up PROD environment locally\n1.You can clone this repository from GitHub or install via composer.\n\nNote: Delete `storage/mysql-data` and `vendor` folder if it is exists.\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-nginx-php-laravel example-app\n```\n\n2.Edit `compose-prod.yaml` and set necessary user/password for MySQL.\n\n3.Edit `env.prod` and set necessary user/password for MySQL.\n\nNote: If you want to change default docker configurations (web_port, etc...) - create uncommitted `.env` file, copy data from `.env.prod`, edit necessary environment variable value.\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:\n```bash\nmake migrate-no-test\n```\n\n6.Set key for application:\n```bash\nmake key-generate\n```\n\n## Getting shell to container\nAfter application will start (`make start`) and in order to get shell access inside laravel 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-nginx`, `make ssh-supervisord`, `make ssh-mysql`.\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-dev\nmake env-test-ci\n\nmake ssh\nmake ssh-root\nmake fish\nmake ssh-nginx\nmake ssh-supervisord\nmake ssh-mysql\n\nmake composer-install-no-dev\nmake composer-install\nmake composer-update\nmake composer-audit\n\nmake key-generate\n\nmake info\nmake help\n\nmake logs\nmake logs-nginx\nmake logs-supervisord\nmake logs-mysql\n\nmake drop-migrate\nmake migrate-no-test\nmake migrate\n\nmake seed\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* [Laravel 11](https://laravel.com)\n* [phpunit](https://github.com/sebastianbergmann/phpunit)\n* [laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper)\n* [scriptsdev](https://github.com/neronmoon/scriptsdev)\n* [composer-bin-plugin](https://github.com/bamarni/composer-bin-plugin)\n* [ergebnis/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* [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/nunomaduro/larastan)\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\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 it's 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-nginx-php-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemsdk%2Fdocker-nginx-php-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsdk%2Fdocker-nginx-php-laravel/lists"}