{"id":19651402,"url":"https://github.com/sourceboat/docker-laravel","last_synced_at":"2025-04-28T16:31:30.568Z","repository":{"id":42579250,"uuid":"200842543","full_name":"sourceboat/docker-laravel","owner":"sourceboat","description":"A highly opinionated docker image which aims to be perfectly suited to run our Laravel applications.","archived":false,"fork":false,"pushed_at":"2022-12-09T10:01:56.000Z","size":151,"stargazers_count":11,"open_issues_count":5,"forks_count":2,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-04-05T09:51:08.747Z","etag":null,"topics":["docker","hacktoberfest","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/sourceboat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T11:59:57.000Z","updated_at":"2024-10-26T16:45:33.000Z","dependencies_parsed_at":"2023-01-25T12:55:11.364Z","dependency_job_id":null,"html_url":"https://github.com/sourceboat/docker-laravel","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceboat%2Fdocker-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceboat%2Fdocker-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceboat%2Fdocker-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceboat%2Fdocker-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourceboat","download_url":"https://codeload.github.com/sourceboat/docker-laravel/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251345941,"owners_count":21574807,"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","hacktoberfest","laravel","php"],"created_at":"2024-11-11T15:06:27.836Z","updated_at":"2025-04-28T16:31:30.033Z","avatar_url":"https://github.com/sourceboat.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `docker-laravel`\n\n[![Release](https://img.shields.io/github/release/sourceboat/docker-laravel.svg?style=flat-square)](https://github.com/sourceboat/docker-laravel/releases)\n[![Docker Pulls](https://img.shields.io/docker/pulls/sourceboat/docker-laravel.svg?style=flat-square)](https://hub.docker.com/r/sourceboat/docker-laravel/)\n[![Image Size](https://img.shields.io/docker/image-size/sourceboat/docker-laravel?style=flat-square)](https://microbadger.com/images/sourceboat/docker-laravel)\n\nA highly opinionated docker image which aims to be perfectly suited to run our Laravel applications.\n\n## What's included?\n\nThis Image includes some features to ease the work with Laravel in Docker:\n- Tooling and extensions needed for Laravel applications\n- Dependency management: Composer, Npm and Yarn\n- Datastores: MariaDB, MySQL, Redis\n- [Startup commands](#startup-commands)\n\n## Usage\n\nCreate a `Dockerfile` with the following contents (and adjust version tag):\n\n```dockerfile\nFROM sourceboat/docker-laravel:x.x.x\n\n# install yarn dependencies\nCOPY package.json yarn.* ./\nRUN yarn install --pure-lockfile\n\n# copy application\nCOPY . ./\n\n# install composer dependencies\nRUN composer install -d /opt/app --prefer-dist --no-progress --no-interaction --optimize-autoloader\n\n# create storage symlink\nRUN php artisan storage:link\n\n# build assets\nRUN yarn production\n```\n\nCreate a `docker-compose.yml` with the following contents:\n\n```yml\nversion: '3.7'\nservices:\n  app:\n    build: .\n    restart: unless-stopped\n    environment:\n      - PHP_OPCACHE_VALIDATE_TIMESTAMPS=1\n      - PHP_MEMORY_LIMIT=1G\n      - PHP_MAX_EXECUTION_TIME=30\n      - STARTUP_COMMAND1=/root/modules/dev.sh\n      - STARTUP_COMMAND2=php artisan migrate --force\n      - STARTUP_COMMAND3=php artisan setup\n    volumes:\n      - ./:/opt/app:cached\n    ports:\n      - \"8080:8080\"\n    depends_on:\n      - mysql\n  mysql:\n    image: mysql:8.0\n    environment:\n      - \"MYSQL_ROOT_PASSWORD=secret\"\n      - \"MYSQL_DATABASE=default\"\n```\n\nAdd more services (e.g. `redis`) if needed.\n\nMake sure to adjust your `.env` accordingly and set `APP_URL` to `http://localhost:8080`.\n\nRun `docker-compose up` to start the services.\n\n### Startup Commands\n\nFurther commands can be defined via ENV variable `STARTUP_COMMANDXXX`, which are executed at container start before the actual command.\n\nThe commands must be numbered sequentially and start with 1 (e.g. `STARTUP_COMMAND1=command`, `STARTUP_COMMAND2=...`).\n\n```yml\nversion: '3.7'\nservices:\n  app:\n    image: sourceboat/docker-laravel\n    restart: unless-stopped\n    environment:\n      - PHP_OPCACHE_VALIDATE_TIMESTAMPS=1\n      - PHP_MEMORY_LIMIT=1G\n      - PHP_MAX_EXECUTION_TIME=30\n      - STARTUP_COMMAND1=/root/modules/storage.sh\n      - STARTUP_COMMAND2=/root/modules/cache.sh\n      - STARTUP_COMMAND3=php artisan migrate --force\n      - STARTUP_COMMAND4=php artisan horizon:restart\n    volumes:\n      - ./:/opt/app:cached\n    ports:\n      - \"8080:8080\"\n    depends_on:\n      - mysql\n  mysql:\n    image: mysql:8.0\n    environment:\n      - \"MYSQL_ROOT_PASSWORD=secret\"\n      - \"MYSQL_DATABASE=default\"\n```\n\n## Changelog\n\nCheck [releases](https://github.com/sourceboat/docker-laravel/releases) for all notable changes.\n\n## Credits\n\n- [Phil-Bastian Berndt](https://github.com/pehbehbeh)\n- [Philipp Kübler](https://github.com/PKuebler)\n- [Kevin Buchholz](https://github.com/NeroAzure)\n- [Hauke Ingwersen](https://github.com/hingew)\n- [All Contributors](https://github.com/sourceboat/docker-laravel/graphs/contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceboat%2Fdocker-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourceboat%2Fdocker-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceboat%2Fdocker-laravel/lists"}