LoginSignup
5
1

More than 3 years have passed since last update.

ElasticBeanstalkにLaravelアプリケーションをリリースするときのebextension設定

Posted at

Laravelをプロダクションでリリースするときには、configキャッシュやrouteキャッシュをすると、より効率的に実行されてアプリケーションのレスポンスが向上します。

ElasticBeanstalkにリリースする場合は、.ebextensions/*に.configファイルを置くことで、リリース時のコマンドを追加することが出来ます。

.ebextensions/laravel_cache.config
container_commands:
  01-cache_config:
    command: "php artisan config:cache"
  02-cache_route:
    command: "php artisan route:cache"
  03-cache_view:
    command: "php artisan view:cache"

以上で、config、route、viewのキャッシュをアプリケーションをアップロードした後に生成することが出来ます。container_commandsはApacheサーバーの再起動前に実行されます。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1