{"id":19427156,"url":"https://github.com/apphp/laravel-docker","last_synced_at":"2026-04-21T05:34:17.273Z","repository":{"id":62486360,"uuid":"442286795","full_name":"apphp/laravel-docker","owner":"apphp","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-07T14:02:37.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T02:33:04.626Z","etag":null,"topics":["docker","docker-compose","laravel"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/apphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2021-12-27T22:22:26.000Z","updated_at":"2022-08-30T20:03:10.000Z","dependencies_parsed_at":"2024-11-10T18:03:02.388Z","dependency_job_id":null,"html_url":"https://github.com/apphp/laravel-docker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/apphp/laravel-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apphp%2Flaravel-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apphp%2Flaravel-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apphp%2Flaravel-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apphp%2Flaravel-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apphp","download_url":"https://codeload.github.com/apphp/laravel-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apphp%2Flaravel-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32079052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-compose","laravel"],"created_at":"2024-11-10T14:10:37.770Z","updated_at":"2026-04-21T05:34:17.256Z","avatar_url":"https://github.com/apphp.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Docker\n\nA pretty simple Docker Compose workflow that sets up your own network of containers for local Laravel development. \n\n## Usage\n\nTo get started, make sure you have Docker installed on your system, and then clone this repository:\n- [Docker for Windows](https://docs.docker.com/desktop/windows/install/)\n- [Docker for Mac](https://docs.docker.com/desktop/mac/install/)\n- [Docker for Other](https://docs.docker.com/compose/install/)\n\n\nTo start working with docker do following \n\n1. Open a terminal and navigate to the directory you cloned this\n   or copy `docker/` directory and `docker-composer.yml` to your current project and navigate to there.\n\n2. Rename everywhere in files `myapp` name with the name you prefer for your application.\n\n3. Run following command to spin up the containers for the web server:\n\n~~~yaml\ndocker-compose up --build -d\n~~~\n\nAfter building containers you may up them by following command:\n~~~yaml\ndocker-compose up -d\n~~~\nor down with \n~~~yaml\ndocker-compose down\n~~~\n\n\nAfter successful building your website will be accessible via:\n~~~\nhttp://localhost:8081\n~~~\n\n## Schema\n~~~\n   ___________     ___________     ___________     ___________\t\n   |         |     |         |     |         |     |         |\n   |  NGINX  | --→ | PHP-FPM |     | PHP-CLI |     |  REDIS  |  \n   |         |\t   |         |     |         |     |         |\n   -----------\t   -----------     -----------     -----------\n        |               |               |\n        ↓               ↓               ↓           \n   ____________   ______________________________   ______________\n   |  Static  |   |                            |   |            |\n   | Content  |   |           CODE             |\u003c--| Node \u0026 Npm |\n   | CSS,JS.. |   |                            |   |            |\n   ------------   ------------------------------   --------------\n~~~\n\n## Environment Configuration\n\nMake sure you created following keys in your `.env` file:\n~~~yaml\nDB_DATABASE=your-db\nDB_USERNAME=your-db-username\nDB_PASSWORD=your-db-password\n~~~\n\n\n## Persistent MySQL Storage\n\nWhen you bring down the Docker network, your MySQL data will be removed after the containers are destroyed. This is a default behaviour of Docker containers. \nIf you would like to have persistent data that remains after bringing containers down and back up, do the following:\n\n1. Create a `./storage/docker/mysql` folder in your Laravel project root.\n2. Under the mysql service in your `docker-compose.yml` file, add the following lines:\n\n```\nvolumes:\n  - ./storage/docker/mysql:/var/lib/mysql\n```\n\n\n## Working with PHP-CLI\n\n#### Migrations, Seeders and Import DB\nAfter successful building and running docker containers you may run migrations and seeders.\nTo perform these operations, simply type in your terminal and execute following commands:\n\n```\ndocker-compose run --rm php-cli php artisan migrate\ndocker-compose run --rm php-cli php artisan db:seed\n```\n\n#### Working with Composer\nTo install/remove new package run following commands:\n```\ndocker-compose run --rm php-cli composer require predis/predis\n```\n\nOther commands you would like to run:\n```\ndocker-compose run --rm php-cli composer --version\ndocker-compose run --rm php-cli composer dump-autoload\ndocker-compose run --rm php-cli composer test ExampleTest\n```\n\n#### Working with PHP \u0026 Artisan\nExample of commands you would like to run:\n```\ndocker-compose run --rm php-cli php -v\ndocker-compose run --rm php-cli php artisan migrate\ndocker-compose run --rm php-cli php artisan db:seed\ndocker-compose run --rm php-cli php artisan optimize:clear\ndocker-compose run --rm php-cli php artisan schedule:run\n```\n\n#### Working with Git\n```\ndocker-compose run --rm php-cli git branch\ndocker-compose run --rm php-cli git pull\n```\n\n#### Working with Redis\n```\ncomposer require predis/predis\ndocker exec -it redis bash\nping\nredis-cli\nkeys *\nset name John\nget name\nexit\n```\n\n#### Working with Node \u0026 NPM\n```\ndocker-compose run --rm node npm run dev\ndocker-compose run --rm node npm run watch\ndocker-compose run --rm node npm run hot\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapphp%2Flaravel-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapphp%2Flaravel-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapphp%2Flaravel-docker/lists"}