{"id":17096134,"url":"https://github.com/ega4432/serverless-laravel","last_synced_at":"2026-02-13T15:05:45.144Z","repository":{"id":52015879,"uuid":"364591771","full_name":"ega4432/serverless-laravel","owner":"ega4432","description":"This is a sample repository of Serverless LAMP stack.","archived":false,"fork":false,"pushed_at":"2023-02-01T22:35:45.000Z","size":3613,"stargazers_count":0,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-31T12:41:43.641Z","etag":null,"topics":["aurora-serverless","docker","lambda","lamp-stack","laravel","php","serverless-framework"],"latest_commit_sha":null,"homepage":"https://zenn.dev/ysmtegsr/articles/187f95cffb7f68f36ccf","language":"PHP","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/ega4432.png","metadata":{"files":{"readme":"README.ja.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}},"created_at":"2021-05-05T13:47:23.000Z","updated_at":"2022-11-16T03:17:32.000Z","dependencies_parsed_at":"2023-02-17T11:45:58.910Z","dependency_job_id":null,"html_url":"https://github.com/ega4432/serverless-laravel","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ega4432/serverless-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ega4432%2Fserverless-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ega4432%2Fserverless-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ega4432%2Fserverless-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ega4432%2Fserverless-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ega4432","download_url":"https://codeload.github.com/ega4432/serverless-laravel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ega4432%2Fserverless-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29411138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"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":["aurora-serverless","docker","lambda","lamp-stack","laravel","php","serverless-framework"],"created_at":"2024-10-14T14:44:42.209Z","updated_at":"2026-02-13T15:05:45.123Z","avatar_url":"https://github.com/ega4432.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Laravel\n\n[![automatic release](https://github.com/ysmtegsr/serverless-laravel/actions/workflows/release.yml/badge.svg)](https://github.com/ysmtegsr/serverless-laravel/actions/workflows/release.yml)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/ysmtegsr/serverless-laravel)\n![GitHub](https://img.shields.io/github/license/ysmtegsr/serverless-laravel)\n\n[ [English](https://github.com/ysmtegsr/serverless-laravel) | Japanese ]\n\nサーバーレス LAMP スタックのサンプルリポジトリです。\n\nサーバーレス LAMP スタックについて詳しく知りたいという方は下記の AWS ブログの記事を参照ください。\n\n[新しいサーバーレス LAMP スタック – Part 1: 概要紹介 \\| Amazon Web Services ブログ](https://aws.amazon.com/jp/blogs/news/introducing-the-new-serverless-lamp-stack/)\n\n## セットアップ\n\n[Laravel Sail](https://readouble.com/laravel/8.x/ja/sail.html) を使って環境構築を行います。Sail は、ローカルマシンで Laravel アプリケーションを開発するための Docker 環境を簡単に作ることができます。\n\n```sh\n$ curl -s \"https://laravel.build/serverless-laravel\" | bash\n\n# If you have a component you want, add queries like this:\n# curl -s \"https://laravel.build/serverless-laravel?with=mysql,redis\" | bash\n```\n\n## コンテナのビルド\n\n```sh\n$ ./vendor/bin/sail up -d\n```\n\n## サーバーレスのセットアップ\n\nサーバーレス Laravel を構築する上で Bref ライブラリをインストールします。\n\nBref というのは、Laravel アプリケーションを AWS Lambda 上で実行する環境を簡単に作流ことができる優れものです。\n\n[Serverless Laravel applications \\- Bref](https://bref.sh/docs/frameworks/laravel.html)\n\n```sh\n# Add libraries\n$ ./vendor/bin/sail composer require bref/bref bref/laravel-bridge\n\n# Copy yaml of serverless.\n$ ./vendor/bin/sail artisan vendor:publish --tag=serverless-config\n```\n\n\n## ローカルでの開発\n\nよく使うであろうコマンドの実行方法を記載しました。\n\n```sh\n# migrate\n$ ./vendor/bin/sail artisan migrate\n\n# seed\n$ ./vendor/bin/sail artisan db:seed\n\n# install npm packages\n$ ./vendor/bin/sail npm i\n```\n\n環境変数用の yml ファイルを serverless framework のスタック名でコピーします。\n\n```sh\n$ cp ./serverless-config/env/stack.yml.example ./serverless-config/env/\u003cyour stack\u003e.yml\n```\n\nDocker コンテナをカスタマイズしたくなったら、下記のように publish して Dockerfile を編集します。\n\n```sh\n$ ./vendor/bin/sail artisan sail:publish\nCopied Directory [/vendor/laravel/sail/runtimes] To [/docker]\nPublishing complete.\n```\n\nローカル DB を直接 SQL を実行したい場合は、コンテナに入って確認することができます。（もちろん tinker を使う方法もあります。）\n\n```sh\n# Set variables\n$ MYSQL_USER=\u003cuser_name\u003e\n$ MYSQL_PASSWORD=\u003cpassword\u003e\n$ MYSQL_DATABASE=\u003cdatabase_name\u003e\n\n$ docker-compose exec mysql bash -c 'mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}'\n```\n\n*Tips*\n\n何度も使うコマンドは、エイリアスを設定しておくと良いでしょう。\n\n```sh\n# sail\nalias sail=\"./vendor/bin/sail\"\n\n# bref\nalias bref=\"./vendor/bin/bref\"\n```\n\n## デプロイ\n\n### 動的アプリケーション\n\n[Serverless Framework CLI](https://www.serverless.com/framework/docs/providers/aws/cli-reference/) を使ってデプロイします。\n\nマイグレーションやシードを行いたい場合は、[Bref CLI](https://bref.sh/docs/runtimes/console.html) を使って行ます。\n\n```sh\n$ seleverless deploy -v\n# or\n$ sls deploy -v\n\n# migrate\n$ ./vendor/bin/bref cli \u003cartisan function\u003e --region \u003cregion\u003e -- migrate\n\n# seed\n$ ./vendor/bin/bref cli \u003cartisan function\u003e --region \u003cregion\u003e -- db:seed\n```\n\n### 静的アセット\n\n[AWS CLI](https://aws.amazon.com/jp/cli/) を使って、S3 バケットにデプロイします。\n\n```sh\n$ ./vendor/bin/sail npm run prod\n\n$ aws s3 sync public/ s3://\u003cbucket-name\u003e/ --delete --exclude index.php\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fega4432%2Fserverless-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fega4432%2Fserverless-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fega4432%2Fserverless-laravel/lists"}