{"id":17085551,"url":"https://github.com/jeroen-g/alpine-artisan","last_synced_at":"2025-04-12T21:36:53.413Z","repository":{"id":52540163,"uuid":"264295961","full_name":"Jeroen-G/alpine-artisan","owner":"Jeroen-G","description":"A set of lightweight Docker images created with Laravel in mind, but work just as fine for other applications.","archived":false,"fork":false,"pushed_at":"2024-12-18T10:57:07.000Z","size":28,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T15:48:10.703Z","etag":null,"topics":["alpine-linux","docker","laravel"],"latest_commit_sha":null,"homepage":"https://jeroeng.dev/blog/dockerizing-laravel-in-15-minutes/","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/Jeroen-G.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":"2020-05-15T20:49:42.000Z","updated_at":"2024-12-18T10:57:11.000Z","dependencies_parsed_at":"2024-03-15T14:30:16.973Z","dependency_job_id":"26163758-8f8e-45ed-9459-ef50e3b7a6b4","html_url":"https://github.com/Jeroen-G/alpine-artisan","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/Jeroen-G%2Falpine-artisan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2Falpine-artisan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2Falpine-artisan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2Falpine-artisan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jeroen-G","download_url":"https://codeload.github.com/Jeroen-G/alpine-artisan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637726,"owners_count":21137534,"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":["alpine-linux","docker","laravel"],"created_at":"2024-10-14T13:25:10.426Z","updated_at":"2025-04-12T21:36:53.390Z","avatar_url":"https://github.com/Jeroen-G.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏔️ *Artisanal Docker images with Alpine Linux*\n\n[![Docker Pulls][ico-pulls]][link-docker-hub]\n[![Docker Image Size (latest by date)][ico-size]][link-docker-hub]\n\nA set of lightweight Docker images created with Laravel in mind, but work just as fine for other applications.\nAt the basis lies Alpine Linux and the amazing [Docker-Webstack](https://github.com/eXistenZNL/Docker-Webstack) which keeps the images that you pull in very small but usable.\n\nThe image sets you up with Alpine Linux, PHP-FPM, Nginx. Currently there is an image for different PHP versions available.\n\n## Installation\nIn the folder of your application create two files: `docker-compose.yml` and `Dockerfile` (note that the latter has no extension). On the command line, run `docker compose up -d --build` and view your containerized application at `localhost:80`.\n\nThe docker image contains a healthcheck. You can run the command `docker-compose ps` to see if the build was succesful, the state should mention \"Up (healthy)\" for the app container.\n\n### Docker-compose.yml\n```yaml\nservices:\n  app:\n    build: .\n    ports:\n      - 80:80\n    volumes:\n      - .:/www:delegated\n```\n\n### Dockerfile\n```Dockerfile\nFROM jeroeng/alpine-artisan:web8.3\n```\n\n## Configuration\nIn the end, the best Docker setup is one you create yourself. That being said, this is how you could quickly build upon the Docker image from this repository.\n\n### Using a database\n[Percona](https://hub.docker.com/_/percona) is an (optimized) version of MySQL and very useful as your database server. Add the following to your docker-compose.yml file:\n\n```yaml\nservices:\n  # app container definition\n\n  db:\n    image: percona:5.7\n      environment:\n        MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-secret}\n        MYSQL_DATABASE: my_database\n        MYSQL_USER: jeroen\n        MYSQL_PASSWORD: ${MYSQL_ROOT_PASSWORD:-secret}\n      volumes:\n        - mysql-data:/var/lib/mysql:rw\n      ports:\n        - 3306:3306\nvolumes:\n  mysql-data: # nothing necessary here, let Docker manage the storage\n```\n\nYour application's .env should contain the following environment variables, after that run `docker compose up -d --build` again to have a database container running next to your app.\n\n```.env\nDB_CONNECTION=mysql\nDB_HOST=database\nDB_PORT=3306\nDB_DATABASE=my_database\nDB_USERNAME=jeroen\nDB_PASSWORD=secret\n```\n\n### Using Redis\nA typical use of redis is for queues (possibly in combination with Laravel Horizon). To have a redis container, add to the docker-compose.yml file:\n\n```yaml\nservices:\n  # app container definition\n\n  queue:\n      image: redis:5-alpine\n      ports:\n        - 6379:6379\n```\n\nAdapt your .env file as well, and after another `docker compose up -d --build` you will have a redis container running for your application (yes, there is no password in this case). If you want to use Horizon, you would still need to install it in your application.\n\n```.env\nQUEUE_CONNECTION=redis\nREDIS_HOST=queue\nREDIS_PASSWORD=\nREDIS_PORT=6379\n```\n\n### Standalone Laravel Horizon\nLaravel Horizon requires a daemon in order to work. If you want to have Laravel Horizon running continuously you may start a new container based on the app one. The image name, `test_app` is unique for your application, `test` is the name of the folder, `app` is the name of the app container. After a `docker-compose build` this image name should be listed when you run `docker images`.\n\n```yaml\nservices:\n  horizon:\n    image: test_app\n    command: php artisan horizon\n```\n\nNote: this only runs horizon locally using docker-compose. As soon as you want to host horizon in a container in the cloud, e.g. using kubernetes, you will have to build a separate image.\n\n## Contributing\nClone this repository and run `make` to see which commands are there to help you. every command requires a `TAG=` parameter, which is the Docker image you want to build, for example: `make build TAG=web8.0`.\n\n[link-docker-hub]: https://hub.docker.com/r/jeroeng/alpine-artisan\n[ico-pulls]: https://img.shields.io/docker/pulls/jeroeng/alpine-artisan?style=flat-square\n[ico-size]: https://img.shields.io/docker/image-size/jeroeng/alpine-artisan?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen-g%2Falpine-artisan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeroen-g%2Falpine-artisan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen-g%2Falpine-artisan/lists"}