{"id":27618027,"url":"https://github.com/markshust/mbox-laravel","last_synced_at":"2025-04-23T04:59:18.694Z","repository":{"id":274807711,"uuid":"924138214","full_name":"markshust/mbox-laravel","owner":"markshust","description":"Mbox, a Docker development environment for Laravel.","archived":false,"fork":false,"pushed_at":"2025-01-29T17:42:19.000Z","size":6,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T04:59:13.545Z","etag":null,"topics":["development","devenv","docker","environment","laravel"],"latest_commit_sha":null,"homepage":"https://m.academy","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/markshust.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T13:39:58.000Z","updated_at":"2025-02-06T18:04:55.000Z","dependencies_parsed_at":"2025-01-29T18:37:21.876Z","dependency_job_id":null,"html_url":"https://github.com/markshust/mbox-laravel","commit_stats":null,"previous_names":["markshust/docker-laravel","markshust/mbox-laravel"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markshust%2Fmbox-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markshust%2Fmbox-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markshust%2Fmbox-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markshust%2Fmbox-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markshust","download_url":"https://codeload.github.com/markshust/mbox-laravel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372921,"owners_count":21419722,"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":["development","devenv","docker","environment","laravel"],"created_at":"2025-04-23T04:59:18.168Z","updated_at":"2025-04-23T04:59:18.686Z","avatar_url":"https://github.com/markshust.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🟧 Mbox for Laravel\n\nYou've stumbled upon Mbox, a Docker development environment for Laravel.\n\n\u003cimg src=\"https://img.shields.io/badge/maintained%3F-yes-brightgreen.svg\" alt=\"Maintained - Yes\" /\u003e\n\nThis repository is a streamlined Docker development environment for Laravel. It uses compact Docker images like Alpine, includes SSL and Xdebug support out of the box, and is aimed at providing you with a highly configurable environment.\n\nNote that Docker images are not pre-built, but will be automatically built on your machine when you run `docker compose up -d` for the first time. This means that you do not need to rely on updates from remote repositories, and can easily customize the images to your liking. \n\n## Table of contents\n- [Why?](#why)\n- [Setup](#setup)\n  - [Laravel](#laravel)\n  - [dnsmasq](#dnsmasq)\n  - [SSL/HTTPS](#sslhttps)\n  - [Xdebug](#xdebug)\n- [Usage](#usage)\n- [Credits](#credits)\n- [License](#license)\n\n## Why?\n\nSolutions like Valet and Sail are too bloated, cumbersome, and contain too much magic. They are also too restrictive, and cannot easily be ported to or used within production environments.\n\nMbox is meant to get your Laravel instance up \u0026 running with minimal hassle, and includes automated SSL termination with Traefik, as well as full support for Vite HMR over Docker + SSL.\n\n## Setup\n\n### Laravel\n\nCopy these directories and files over to your Laravel project:\n- `docker`: Docker images and configuration files\n- `compose.yaml`: Docker Compose configuration\n- `vite.config.js`: Vite configuration, replace `acme.test` with your domain\n\nCopy the values from `.env.docker` over to your main `.env` file, and modify them as necessary.\n\n- `DOCKER_TRAEFIK_IDENTIFIER`: set this to your project name, ex. `acme`\n- `DOCKER_TRAEFIK_DOMAIN`: set this to your domain, ex. `acme.test`\n- `FORWARD_PORT_*`: set these to the ports you want to forward to the respective services\n- `MARIADB_*`: set these to the values you want for your MariaDB instance\n\nYou will also want to update your Laravel env vars, specifically `HOST` values, to match their respective Docker service names and ports. For example, `DB_HOST` should be changed from `localhost` to `mariadb`, as `mariadb` is the name of the service as defined within Docker.\n\n\u003e **Note:** You should still use either `localhost` or your local .test domain when connecting to services such as MySQL from your host machine, as Docker will automatically route requests to the correct service.\n\n### dnsmasq\n\nThis project relies on dnsmasq to route requests made to `*.test` to `localhost`. You can easily set this up by running:\n\n```bash\nbrew install dnsmasq\nmkdir -pv $(brew --prefix)/etc/\necho 'address=/.test/127.0.0.1' \u003e\u003e $(brew --prefix)/etc/dnsmasq.conf\nsudo brew services start dnsmasq\nsudo mkdir -v /etc/resolver\nsudo bash -c 'echo \"nameserver 127.0.0.1\" \u003e /etc/resolver/test'\n```\n\n### SSL/HTTPS\n\nThis project uses Traefik to terminate SSL, so you will need to generate a wildcard SSL cert for your domain.\n\nInstall `mkcert` to generate local SSL certs:\n\n```yaml\nbrew install mkcert\nmkcert -install\n```\n\nThen make a wildcard cert:\n\n```yaml\nmkcert -key-file docker/ssl/ssl.key -cert-file docker/ssl/ssl.crt \"*.test\"\n```\n\nAnd set proper permissions on the cert and key:\n\n```diff\nchmod 600 docker/ssl/ssl.crt \nchmod 400 docker/ssl/ssl.key\n```\n\nYou'll also want to be sure to add the `/docker/ssl` directory in your `.gitignore` file.\n\n### Xdebug\n\nXdebug is automatically enabled and set to `debug` mode by default. If you wish to disable or change this setting, modify the `docker/images/phpfpm/conf/php.ini` file and then restart the phpfpm container.\n\n## Usage\n\n- `docker compose up -d`: Start the containers\n- `docker compose down`: Stop the containers\n- `docker compose restart`: Restart the containers\n- `docker compose restart phpfpm`: Restart the phpfpm container\n- `docker compose up -d --build`: Rebuild the containers\n- `docker compose exec phpfpm php`: Run PHP commands\n- `docker compose exec node npm`: Run npm commands\n\n## Credits\n\n### M.academy\n\nThis repository is sponsored by \u003ca href=\"https://m.academy\" target=\"_blank\"\u003eM.academy\u003c/a\u003e, the simplest way to learn complex tech skills.\n\n\u003ca href=\"https://m.academy\" target=\"_blank\"\u003e\u003cimg src=\"https://m.academy/images/logo.png\" alt=\"M.academy\"\u003e\u003c/a\u003e\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkshust%2Fmbox-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkshust%2Fmbox-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkshust%2Fmbox-laravel/lists"}