{"id":18668721,"url":"https://github.com/rinminase/laravel-docker-template","last_synced_at":"2026-04-06T08:01:34.019Z","repository":{"id":170012004,"uuid":"645344035","full_name":"RinMinase/laravel-docker-template","owner":"RinMinase","description":"📦🐞 An extremely simple and lightweight Laravel Docker Template","archived":false,"fork":false,"pushed_at":"2026-03-25T10:30:09.000Z","size":361,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-26T13:14:55.283Z","etag":null,"topics":["alpine-linux","docker","laravel","nginx","postgresql","template"],"latest_commit_sha":null,"homepage":"","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RinMinase.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-25T12:52:14.000Z","updated_at":"2026-03-25T10:01:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"42d83a00-13ce-4122-a61e-907862d354bd","html_url":"https://github.com/RinMinase/laravel-docker-template","commit_stats":null,"previous_names":["rinminase/laravel-docker-template"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/RinMinase/laravel-docker-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Flaravel-docker-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Flaravel-docker-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Flaravel-docker-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Flaravel-docker-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RinMinase","download_url":"https://codeload.github.com/RinMinase/laravel-docker-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Flaravel-docker-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["alpine-linux","docker","laravel","nginx","postgresql","template"],"created_at":"2024-11-07T08:44:41.839Z","updated_at":"2026-04-06T08:01:33.998Z","avatar_url":"https://github.com/RinMinase.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://laravel.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg\" width=\"400\" alt=\"Laravel Logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Introduction / Motivation of this project\nI'm sick of other extremely complicated and lengthy guides and tutorials on how to create a Dockerized Laravel (see [here](https://www.cloudsigma.com/deploying-laravel-nginx-and-mysql-with-docker-compose/), [here](https://www.digitalocean.com/community/tutorials/how-to-install-and-set-up-laravel-with-docker-compose-on-ubuntu-22-04), [here](https://blog.logrocket.com/how-to-run-laravel-docker-compose-ubuntu-v22-04/) and [here](https://www.twilio.com/blog/get-started-docker-laravel)), so I created one myself. Using this is as simple as cloning or downloading the whole template then running `docker-compose up -d`, setup can be finished in more-or-less 5-10 minutes.\n\n## Using the template\n\n### Using Git template\n1. Click `Use this template` then `Create a new repository`\n2. Clone your newly created repository\n3. Copy the env file by running `cp .env.example .env`\n4. Create and run the docker containers by `docker-compose up -d`\n5. Navigate in the created container `docker exec -it php sh`\n6. Run the commands below to start your Laravel application\n  ```\n  composer install\n  php artisan key:generate\n  php artisan migrate:fresh --seed\n  ```\n\n### Using Git clone\n1. Clone the repository by running `git clone git@github.com:RinMinase/laravel-docker-template.git`\n2. Remove instances of the original repository on your project\n  - Open your terminal and run these commands below:\n    - `git remote remove origin`\n    - `rm -rf .git/`\n    - `git init`\n3. Copy the env file by running `cp .env.example .env`\n4. Create and run the docker containers by `docker-compose up -d`\n5. Navigate in the created container `docker exec -it php sh`\n6. Run the commands below to start your Laravel application\n  ```\n  composer install\n  php artisan key:generate\n  php artisan migrate:fresh --seed\n  ```\n\n### Downloading the repository\n1. Download the repository as a zip file\n2. Copy the env file by running `cp .env.example .env`\n3. Create and run the docker containers by `docker-compose up -d`\n5. Navigate in the created container `docker exec -it php sh`\n6. Run the commands below to start your Laravel application\n  ```\n  composer install\n  php artisan key:generate\n  php artisan migrate:fresh --seed\n  ```\n\n## Default Values\n\nThis project contains 3 docker containers, all of which uses the official docker images in Alpine linux\n- `php` (which houses your source code)\n  - container name: `php`\n- `nginx` (which houses the webserver that runs your code in a browser)\n  - container name: `webserver`\n- `db` (which contains the database of your project)\n  - container name: `database`\n  - by default this uses [PostgreSQL](https://www.postgresql.org/), but feel free to change it to your desired database\n\nThe database by default uses these default parameters to let you get started without even touching any configuration settings\n- `DB_DATABASE` or your default database name: `laravel`\n- `DB_USERNAME` or your default database username: `postgres`\n- `DB_PASSWORD` or your default database password: `postgres`\n\n\n### Job / Commands / Schedule updates and restarting the supervisor\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\nIn cases there are any updates to:\n- Jobs (found on `app/Jobs`)\n- Commands (found on `app/Commands`)\n- Schedules (found on `bootstrap/app.php` under `withSchedule`)\n\nPlease run the following: \n\n1. Navigate inside the `php` docker container [[how]](#re-running-the-project)\n\n2. Run the command to restart the \u003cworker\u003e group (`queue-worker` and `schedule-worker`)\n\n    ```bash\n    supervisorctl restart worker:\n    ```\n\n\n### Managing the supervisor\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\nThis application runs supervisor on the `php` container. Supervisor runs these tasks:\n\n| Task Name       | Group   | Command                     | Description                    |\n| --------------- | ------- | --------------------------- | ------------------------------ |\n| php-fpm         | -       | `php-fpm`                   | Runs FastCGI Process Manager   |\n| queue-worker    | worker  | `php artisan queue:work`    | Runs Laravel's Queue worker    |\n| schedule-worker | worker  | `php artisan schedule:work` | Runs Laravel's Schedule worker |\n\nTo manage the supervisor the commands below can be used:\n\n| Command                           | Description                                    |\n| --------------------------------- | ---------------------------------------------- |\n| supervisorctl reread              | Re-reads changes in supervisor config files    |\n| supervisorctl update              | Updates supervisor with changes after `reread` |\n| supervisorctl status              | Check status of all running tasks              |\n| supervisorctl start \u003ctask name\u003e   | Starts the task                                |\n| supervisorctl stop \u003ctask name\u003e    | Stops the task                                 |\n| supervisorctl restart \u003ctask name\u003e | Restarts the task                              |\n\n**Please note:** Supervisor logs are kept in `./docker/logs/supervisor.log`\n\n## FAQ\n\n### How to update PHP / caddy / PostgreSQL?\n\n- Updating `PHP`\n  - Modify the version text under `docker-compose.yml` under `services : php : build : args`, `PHP_VERSION`\n  - Example here: https://github.com/RinMinase/laravel-docker-template/blob/15c9c74cb13e085fd0db2efa83bf9986fded29c5/docker-compose.yml#L15\n  - You can find the php versions possible [here](https://hub.docker.com/_/php/tags?page=1\u0026name=fpm-alpine)\n- Updating `caddy`\n  - Modify the version text under `docker-compose.yml` under `services : caddy : image`, and change the version of the image name\n  - Example here: https://github.com/RinMinase/laravel-docker-template/blob/15c9c74cb13e085fd0db2efa83bf9986fded29c5/docker-compose.yml#L328\n  - You can find the caddy versions possible [here](https://hub.docker.com/_/caddy/tags?name=alpine)\n- Updating `db`\n  - Modify the version text under `docker-compose.yml` under `services : db : image`, and change the version of the image name\n  - Example here: https://github.com/RinMinase/laravel-docker-template/blob/15c9c74cb13e085fd0db2efa83bf9986fded29c5/docker-compose.yml#L65\n  - You can find the postgres versions possible [here](https://hub.docker.com/_/postgres/tags?page=1\u0026name=-alpine)\n\n### Why use official images?\n\nOther tutorials or guides uses customized images (see [here for the guide](https://www.digitalocean.com/community/tutorials/how-to-install-and-set-up-laravel-with-docker-compose-on-ubuntu-22-04) -- actual [line of code](https://github.com/do-community/travellist-laravel-demo/blob/cb9abd07cb6e8fb46d12c0f9cd650f3a6b976307/docker-compose.yml#L10)), these images are so hard to update manually compared to just editing a value then rebuilding the whole container again, see the question above on how to update each docker container.\n\n### Why use alpine linux?\n\nAlpine linux is very lightweight and secure enough. Since the image used is lightweight, you can quickly download it compared to fully-fledged linux distros such as Ubuntu. (Some references for these: [here](https://nickjanetakis.com/blog/the-3-biggest-wins-when-using-alpine-as-a-base-docker-image) and [here](https://sysdig.com/learn-cloud-native/container-security/what-is-docker-alpine/)).\n\nNonetheless, it also has its downsides, (references [here](https://dev.to/kakisoft/dockeralpine-why-you-should-avoid-alpine-linux-44he) and [here](https://www.linkedin.com/pulse/musl-libc-alpines-greatest-weakness-rogan-lynch)) I've even encountered a few of them, these are:\n- using other package managers aside from `apk`\n- some libraries which you may possibly use are not present such as `glibc` since alpine uses `musl-libc` and requires a [sad and annoying workaround](https://stackoverflow.com/a/37835009) for it to work\n\n### Why use (or migrated) to caddy instead of nginx?\n\nCaddy is often preferred over Nginx for its simplicity and modern design. Unlike Nginx, Caddy automatically handles HTTPS with free TLS certificates via Let’s Encrypt, removing the need for manual certificate setup or cron jobs (although this is not used in this repository as it was deemed unnecessary).\n\nAdditionally, its configuration syntax is way cleaner and extremely easier to understand, making it ideal for quick deployments and maintainable setups.\n\nRegardless, if you do prefer nginx, please refer to the previous setup under this commit:\n- https://github.com/RinMinase/laravel-docker-template/tree/258923b0dc2e5fef9f6337954fcebafb59661d2c\n\nThe files needed for it is likewise under `./docker/nginx-backup/*` for the time being. The docker-compose setup is likewise commented as well for now.\n\n### Why use static versions for docker containers?\n\nWhy not? A variable version might mean that it works on my machine but not on yours because yours has a different (possibly newer) version than mine (references [here](https://nickjanetakis.com/blog/docker-tip-18-please-pin-your-docker-image-versions) and [here](https://docs.gradle.org/current/userguide/dependency_locking.html)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Flaravel-docker-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinminase%2Flaravel-docker-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Flaravel-docker-template/lists"}