{"id":13563329,"url":"https://github.com/Cyber-Duck/php-fpm-laravel","last_synced_at":"2025-04-03T19:32:48.451Z","repository":{"id":49093791,"uuid":"95494395","full_name":"Cyber-Duck/php-fpm-laravel","owner":"Cyber-Duck","description":"Docker image for a php-fpm container crafted to run Laravel based applications.","archived":false,"fork":false,"pushed_at":"2024-11-21T09:22:07.000Z","size":119,"stargazers_count":166,"open_issues_count":0,"forks_count":28,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T08:09:33.122Z","etag":null,"topics":["docker","docker-image","laravel","php"],"latest_commit_sha":null,"homepage":null,"language":null,"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/Cyber-Duck.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-06-26T22:21:37.000Z","updated_at":"2025-02-05T10:06:58.000Z","dependencies_parsed_at":"2024-08-01T13:19:16.617Z","dependency_job_id":"08df0ddb-540b-4dfd-a70b-5882a6628f82","html_url":"https://github.com/Cyber-Duck/php-fpm-laravel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyber-Duck%2Fphp-fpm-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyber-Duck%2Fphp-fpm-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyber-Duck%2Fphp-fpm-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyber-Duck%2Fphp-fpm-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyber-Duck","download_url":"https://codeload.github.com/Cyber-Duck/php-fpm-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247065470,"owners_count":20877785,"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":["docker","docker-image","laravel","php"],"created_at":"2024-08-01T13:01:17.925Z","updated_at":"2025-04-03T19:32:48.135Z","avatar_url":"https://github.com/Cyber-Duck.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# PHP-FPM Docker image for Laravel\n\nDocker image for a php-fpm container crafted to run Laravel based applications.\n\n## Specifications:\n\n* PHP 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1 / 7.0 / 5.6 / 5.4\n* OpenSSL PHP Extension\n* PDO PHP Extension\n* SOAP PHP Extension\n* Mbstring PHP Extension\n* Tokenizer PHP Extension\n* XML PHP Extension\n* PCNTL PHP Extension\n* ZIP PHP Extension\n* GD PHP Extension\n* BCMath PHP Extension\n* GMP PHP Extension\n* Intl PHP Extension\n* Imagick PHP Extension\n* Memcached\n* Composer\n* Laravel Cron Job for the [task scheduling](https://laravel.com/docs/11.x/scheduling) setup\n* PHP ini values for Laravel (see [`laravel.ini`](laravel.ini))\n* xDebug (PHPStorm friendly, see [`xdebug.ini`](xdebug.ini))\n* `t` alias created to run unit tests `vendor/bin/phpunit` with `docker-compose exec [service_name] t`\n* `d` alias created to run Laravel Dusk browser tests `artisan dusk` with `docker-compose exec [service_name] d`\n* `art` alias created to run the Laravel `artisan` command\n* `fresh` alias created to migrate the database fresh and seed the seeders `artisan migrate:fresh --seed`\n\n## Tags available:\n\nWhen calling the image you want to use within your `docker-compose.yml` file,\nyou can specify a tag for the image. Tags are used for various versions of a\ngiven Docker image.\n\n* [`8.3`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/8.3)\n* [`8.2`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/8.2)\n* [`8.1`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/8.1)\n* [`8.0`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/8.0)\n* [`7.4`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.4)\n* [`7.3`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.3)\n* [`7.2`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.2)\n* [`7.1`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.1)\n* [`7.0`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.0)\n* [`5.6`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/5.6)\n* [`5.4`](https://github.com/Cyber-Duck/php-fpm-laravel/tree/5.4)\n\n**Note:** the `master` branch is not used for generating images, used for documentation instead. Only tags/branches are.\n\n## docker-compose usage:\n\n```yml\nversion: '2'\nservices:\n    php-fpm:\n        image: cyberduck/php-fpm-laravel(:\u003cversion-tag\u003e)\n        volumes:\n            - ./:/var/www/\n            - ~/.ssh:/root/.ssh # can be useful for composer if you use private CVS\n        networks:\n            - my_net #if you're using networks between containers\n```\n\n## Xdebug usage:\n\nAll images \u003e PHP 8.1 are configured to support xDebug 3.\n\nThe image comes with Xdebug installed but by default it is disabled. Xdebug can be enabled using an environmental\nvariable. This can either be done using the .env file, passing the envs using docker or passing the envs using\ndocker-compose.\n\n### Using .env file\n\nAdd the following to the env file and then start/restart the container.\n\n```text\nXDEBUG=true\nPHP_IDE_CONFIG=\"serverName=phpstorm-server\" # This is required for PhpStorm only for path mappings\nREMOTE_HOST=\"\u003cHOST_IP\u003e\" # If not set the default is 'host.docker.internal' which will work on OSX and windows\n```\n\n### Using docker\n\nPass the required variables with the run command using the -e option.\n\n```bash\ndocker run -d \\\n    -e XDEBUG=true \\\n    -e PHP_IDE_CONFIG=\"serverName=phpstorm-server\" \\ #This is required for PhpStorm only for path mappings\n    -e REMOTE_HOST=\"\u003cHOSTIP\u003e\" \\ # If not set the default is 'host.docker.internal' which will work on OSX and windows\n    -v /root/of/project:/var/www \\ \n    -v ~/.ssh:/root/.ssh \\\n    cyberduck/php-fpm-laravel(:\u003cversion-tag\u003e)\n```\n\n### Using docker-compose\n\nPass the variables in the environment section of the service using this image.\n\n```yml\nversion: '2'\nservices:\n    php-fpm:\n        image: cyberduck/php-fpm-laravel(:\u003cversion-tag\u003e)\n        environment:\n            XDEBUG: true\n            PHP_IDE_CONFIG: \"serverName=phpstorm-server\" #This is required for PhpStorm only for path mappings\n            REMOTE_HOST: \"\u003cHOSTIP\u003e\" # If not set the default is 'host.docker.internal' which will work on OSX and windows\n        volumes:\n            - ./:/var/www/\n            - ~/.ssh:/root/.ssh # can be useful for composer if you use private CVS\n        networks:\n            - my_net #if you're using networks between containers\n```\n\n### PhpStorm configuration\n\nFor xdebug to work with PhpStorm you will need to create a server. This can be done by going to **Preferences \u003e\nLanguages \u0026 Frameworks \u003e PHP \u003e Servers** and then follow the steps below.\n\n1, Click the `+` symbol.\n\n2, Create a name for the server. This will be the value of serverName in the PHP_IDE_CONFIG variable e.g\n`PHP_IDE_CONFIG=\"serverName=\u003cCONFIGURED_SERVER_NAME\u003e\"`.\n\n3, Set Host to `http://localhost` or if using a virtual host then use that instead e.g `http://myapp.localhost`.\n\n4, Set the port to the port that is being used on the host machine e.g `80`.\n\n5, Set the debugger to Xdebug.\n\n6, Check the `Use path mappings` checkbox.\n\n7, Under the project files section find the root of the project and on the right hand side fill out its location inside\nthe container e.g `/var/www`.\n\n8, Click apply and close preferences.\n\n9, Start listening for incoming connections by going to **Run \u003e Start listening for PHP debug connections**\n\n10, Xdebug can now be tested by adding a breakpoint or selecting **Run \u003e Break at first line in  PHP scripts** and\nrefreshing the browser.\n\n### Visual studio code configuration\n\nFor Xdebug to work in Visual Studio Code a launch.json will need to be added to .vscode folder in the route of the\nproject. Please see below for an example of a launch.json file\n\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Listen for XDebug\",\n            \"type\": \"php\",\n            \"request\": \"launch\",\n            \"port\": 9000,\n            \"pathMappings\": {\n                \"/var/www\": \"${workspaceFolder}\"\n            }\n        }\n    ]\n}\n```\n\nOnce this has been added then you can navigate to the debug section. On the left hand side under the **BREAKPOINTS**\nsection uncheck the `Everything` checkbox. Now from the dropdown menu at the top select `listen for Xdebug` then press\nthe play button.\n\nXdebug can now be tested by adding a breakpoint and refreshing the browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyber-Duck%2Fphp-fpm-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCyber-Duck%2Fphp-fpm-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyber-Duck%2Fphp-fpm-laravel/lists"}