{"id":19412245,"url":"https://github.com/shipping-docker/php-app","last_synced_at":"2026-01-28T10:33:30.185Z","repository":{"id":89430584,"uuid":"66791342","full_name":"shipping-docker/php-app","owner":"shipping-docker","description":"A containerized Laravel application","archived":false,"fork":false,"pushed_at":"2018-10-08T17:32:10.000Z","size":30,"stargazers_count":278,"open_issues_count":11,"forks_count":73,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-25T02:43:03.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/shipping-docker.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}},"created_at":"2016-08-28T21:19:34.000Z","updated_at":"2024-10-04T13:00:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"974cd0f4-9a20-457f-9d71-b98f7b1537d4","html_url":"https://github.com/shipping-docker/php-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shipping-docker/php-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipping-docker%2Fphp-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipping-docker%2Fphp-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipping-docker%2Fphp-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipping-docker%2Fphp-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shipping-docker","download_url":"https://codeload.github.com/shipping-docker/php-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipping-docker%2Fphp-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-11-10T12:25:54.269Z","updated_at":"2026-01-28T10:33:25.175Z","avatar_url":"https://github.com/shipping-docker.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Containerized PHP Application\n\n\u003ca href=\"https://shippingdocker.com\" title=\"learn how to use docker in dev and production\"\u003e![Shipping Docker video series](https://cloud.githubusercontent.com/assets/467411/18037593/12321512-6d4e-11e6-8514-e8454f4fd286.jpg)\u003c/a\u003e\n\n## What is this?\n\nThis is an example of how you can quickly get up and running with Docker to develop a PHP application. This is a companion to the 🐳 [Shipping Docker](https://shippingdocker.com/) video series.\n\n## Teach me how to use it!\n\nI have a mini-course that uses this example to show you how to get up and running in Docker for development!\n\n**Sign up here to get an email with a link to the mini course to see how this works!**\n\n\u003ca href=\"http://shippingdocker.com/#signup\" title=\"see how to use Docker in development\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/467411/18333423/8ef22c66-7534-11e6-950d-850be40d9af0.png\" alt=\"Shipping Docker mini-course\" width=\"600\" height=\"200\" style=\"width: 600px; height: 200px;\" /\u003e\u003c/a\u003e\n\n## How to use\n\n### 1. Get the files and spin up containers\n\n```bash\n# Get shipping-docker files\ngit clone https://github.com/shipping-docker/php-app.git\ncd php-app\n\n# Start the app, run containers\n#   in the background\n# This will download and build the images\n#   the first time you run this\ndocker-compose up -d\n```\n\nAt this point, we've created containers and have them up and running. However, we didn't create a Laravel application to serve yet. We waited because we wanted a PHP image to get created so we can re-use it and run `composer` commands.\n\n### 2. Create a new Laravel application\n\n```bash\n# From directory \"php-app\"\n# Create a Laravel application\ndocker run -it --rm \\\n    -v $(pwd):/opt \\\n    -w /opt \\\n    --network=phpapp_appnet \\\n    shippingdocker/php \\\n    composer create-project laravel/laravel application\n\ndocker run -it --rm \\\n    -v $(pwd)/application:/opt \\\n    -w /opt \\\n    --network=phpapp_appnet \\\n    shippingdocker/php \\\n    composer require predis/predis\n\n# Restart required to ensure\n# app files shares correctly\ndocker-compose restart\n```\n\nEdit the `application/.env` file to have correct settings for our containers. Adjust the following as necessary:\n\n```\nDB_CONNECTION=mysql\nDB_HOST=db\nDB_PORT=3306\nDB_DATABASE=homestead\nDB_USERNAME=homestead\nDB_PASSWORD=secret\n\nBROADCAST_DRIVER=log\nCACHE_DRIVER=redis\nSESSION_DRIVER=redis\nQUEUE_DRIVER=sync\n\nREDIS_HOST=redis\nREDIS_PASSWORD=null\nREDIS_PORT=6379\n```\n\n\u003e If you already have an application, you can move it to the `application` directory here. Else, you can adjust the shared volume file paths within the `docker-compose.yml` file.\n\u003e \n\u003e If you edit the `docker-compose.yml` file, run `docker-compose down; docker-compose up -d` to suck in the new Volume settings.\n\n**NOTE**: If you're not running Docker Mac/Windows (which run Docker in a small virtualized layer), you may need to set permissions on the shared directories that Laravel needs to write to. The following will let Laravel write the storage and bootstrap directories:\n\n```bash\n# From directory php-app\nchmod -R o+rw application/bootstrap application/storage\n```\n\n### 3. (Optionally) Add Auth Scaffolding:\n\nIf you'd like, we can add Laravel's Auth scaffolding as well. To do that, we need to run some Artisan commands:\n\n```bash\n# Scaffold authentication views/routes\ndocker run -it --rm \\\n    -v $(pwd)/application:/opt \\\n    -w /opt \\\n    --network=phpapp_appnet \\\n    shippingdocker/php \\\n    php artisan make:auth\n\n# Run migrations for auth scaffolding\ndocker run -it --rm \\\n    -v $(pwd)/application:/opt \\\n    -w /opt \\\n    --network=phpapp_appnet \\\n    shippingdocker/php \\\n    php artisan migrate\n```\n\nNow we can start using our application! Head to `http://localhost/register` to see your Laravel application with auth scaffolding in place.\n\n![image](https://cloud.githubusercontent.com/assets/467411/18038743/6ac84008-6d61-11e6-8aa6-30a776b59aaa.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipping-docker%2Fphp-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshipping-docker%2Fphp-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipping-docker%2Fphp-app/lists"}