{"id":19321908,"url":"https://github.com/pascalallen/dockerlaravel","last_synced_at":"2026-04-10T01:56:05.627Z","repository":{"id":47162126,"uuid":"360638235","full_name":"pascalallen/DockerLaravel","owner":"pascalallen","description":"Fully containerized sample web application on PHP version 8 with a Laravel API backend, and a React + SASS frontend. Docker containers for MySQL, NGINX, and PHP-FPM.","archived":false,"fork":false,"pushed_at":"2021-10-28T16:36:32.000Z","size":590,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T05:41:51.938Z","etag":null,"topics":["docker","laravel","mysql","nginx","php","react","sass","typescript"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/pascalallen.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}},"created_at":"2021-04-22T18:02:35.000Z","updated_at":"2022-07-22T15:30:52.000Z","dependencies_parsed_at":"2022-09-04T04:22:07.631Z","dependency_job_id":null,"html_url":"https://github.com/pascalallen/DockerLaravel","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalallen%2FDockerLaravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalallen%2FDockerLaravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalallen%2FDockerLaravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalallen%2FDockerLaravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalallen","download_url":"https://codeload.github.com/pascalallen/DockerLaravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240423042,"owners_count":19798872,"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","laravel","mysql","nginx","php","react","sass","typescript"],"created_at":"2024-11-10T01:39:29.970Z","updated_at":"2026-04-10T01:56:00.590Z","avatar_url":"https://github.com/pascalallen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boilerplate Docker PHP Web App\n\n![NPM Build Status](https://github.com/pascalallen/DockerLaravel/workflows/NPM/badge.svg)\n![Docker Compose Build Status](https://github.com/pascalallen/DockerLaravel/workflows/Docker%20Compose/badge.svg)\n![Laravel Build Status](https://github.com/pascalallen/DockerLaravel/workflows/Laravel/badge.svg)\n\nFully containerized boilerplate web application on PHP version 8 with a Laravel API backend, and a React + SASS frontend. \nDocker containers for MySQL, NGINX, PHP-FPM, and a Worker Queue. Also ships with:\n- Pipelines (GitHub Actions) to fully test the application\n- Google Two-Factor Authentication\n- Instructions to create SSL certificates for automatic HTTPS redirect\n- Slack notifier\n- Papertrail logging\n- Amazon SQS integration\n- Sample job for worker queue\n- Roles and Permissions\n- Sample React components\n- Unit tests\n- Authentication\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/)\n- [Docker Compose](https://docs.docker.com/compose/)\n\n## Development Environment Setup\n\n### Clone Repository\n\n$ `cd \u003cprojects-parent-directory\u003e \u0026\u0026 git clone https://github.com/pascalallen/DockerLaravel.git`\n\n### Create Environment file\n\n$ `cp .env.example .env`\n\n### (Production only) Use certbot on production server to obtain SSL certificate and key files for `\u003cyour-prod-url\u003e.com` and add to project at:\n\n```\netc/nginx/certs/fullchain.pem\netc/nginx/certs/privkey.pem\n```\n\n### (Localhost only) Use openssl command below on localhost to obtain SSL certificate and key files for `localhost` and add to project at `etc/nginx/certs/fullchain.pem` and `etc/nginx/certs/privkey.pem`:\n\n```\nopenssl req -x509 -out localhost.crt -keyout localhost.key \\\n  -newkey rsa:2048 -nodes -sha256 \\\n  -subj '/CN=localhost' -extensions EXT -config \u003c( \\\n   printf \"[dn]\\nCN=localhost\\n[req]\\ndistinguished_name = dn\\n[EXT]\\nsubjectAltName=DNS:localhost\\nkeyUsage=digitalSignature\\nextendedKeyUsage=serverAuth\")\n```\n\n### Bring Up Environment\n\n$ `bin/up`\n\n### Install Composer Dependencies\n\n$ `bin/composer install`\n\n### Set Directory Permissions\n\n$ `chmod -R 777 storage bootstrap/cache`\n\n### Set Application Key\n\n$ `bin/artisan key:generate`\n\n### Clear Application Cache\n\n$ `bin/artisan optimize:clear`\n\n### Run Migrations\n\n$ `bin/artisan migrate`\n\n### Run Seeds\n\n$ `bin/artisan db:seed`\n\n### Install NPM Dependencies\n\n$ `bin/npm install`\n\n### Compile NPM Project\n\n$ `bin/npm run dev`\n\n### Watch For Frontend Changes\n\n$ `bin/npm run watch`\n\n### Take Down Environment\n\n$ `bin/down`\n\n### Run Unit Tests\n\n$ `bin/phpunit`\n\n### Useful Information\n\n#### Host Database Volume\n\nTo ensure that data persists even while the environment is down, we create a volume on the host machine at\n`/var/lib/mysql`. The application's database runs on port 3307 inside of the container and maps to port 3306 on the host\nmachine. The database will not be accessible while the environment is down (obviously), but the data persists thanks to\nour volume. Note: You probably want to exec into the database container (`docker exec -it dockerlaravel-db bash`) and create a\nMySQL user instead of using `root`. Be sure to update the `.env` file with this new user.\n\n#### Slack Notifications\n\nTo allow critical, alert, and emergency level logs to be posted to the application's Slack workspace, add your Slack\nWebhook URL to the `.env` file. For example:\n\n```\nSLACK_WEBHOOK_URL=YOUR_SLACK_WEBHOOK_URL_HERE\n```\n\n#### Papertrail Logging\n\nTo allow debug, info, notice, warning, and error level logs to be posted to the application's Papertrail workspace, add\nyour Papertrail URL and port to the `.env` file. For example:\n\n```\nPAPERTRAIL_URL=null\nPAPERTRAIL_PORT=null\n```\n\n#### Amazon SQS Worker Queue\n\nThis application uses Amazon SQS as it's Worker Queue to create queued jobs. You will need to add your AWS credentials \nto the `.env` file. This configuration assumes that you have already created a queue in AWS with the name of `jobs`:\n\n```\nQUEUE_CONNECTION=sqs\nAWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID_HERE\nAWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE\nAWS_DEFAULT_REGION=us-east-2\nSQS_PREFIX=https://sqs.us-east-2.amazonaws.com/your-account-id\nSQS_QUEUE=jobs\n```\n\n### How It Works\n\nA personal access token is assigned to a user at login. This personal access token is used as a bearer token to\nauthorize requests to the API. In addition to personal access tokens, we are using Laravel's built-in cookie based\nsession authentication services. This provides the benefits of CSRF protection, session authentication, as well as\nprotects against leakage of the authentication credentials via XSS.\n\nNote: The application will only attempt to authenticate using cookies when the incoming request originates from our own\nSPA frontend.\n\nClient-side and server-side (API) routes are restricted to roles/permissions and data sent in requests is validated. The\nentry point to the application is `/`\nand is set in `routes/web.php`. To define a new client-side route, you will need to add the route to our client-side\nrouter located in `resources/js/router/Router.tsx`. To define a new api route, you will need to add the route to our\nserver-side API router located in `routes/api.php`.\n\nDetails will be added as needed. Happy programming!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalallen%2Fdockerlaravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalallen%2Fdockerlaravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalallen%2Fdockerlaravel/lists"}