Search code examples
laravelstateful

Running a Laravel app in Fargate: which folders do I need to persist?


I am going to run a containerized Laravel app on AWS Fargate.

Since the container storage is ephemeral, I wonder if there are some part of the app that I need to store in a stateful storage (EFS).

I'd imagine I should store the session data in storage/framework/sessions.

Should I also keep these?

storage/framework/cache
storage/framework/views

anything else? What is the best practice?

EDIT: I'm going to save the sessions in the DB


Solution

  • yes, keep the session data. You can use the database driver for that. There's no need to save the cache. You may or may not want to save the logs (storage/logs/laravel.log) depending on your use case.