Hello.
I use the spatie/media-library
package to handle media in my Laravel project. The uploaded media gets stored in the storage/app/public
directory. I have already followed the fly.io documentation to persist the storage folder but there seems to be something wrong because I have to constantly run fly ssh console -C "php /var/www/html/artisan storage:link"
to make my files available again.
The only thread related to this issue is this one, which doesn’t seem to fix my problem.
Here is my fly.toml
file:
app = 'the-wordsmiths-collection'
primary_region = 'mad'
console_command = 'php /var/www/html/artisan tinker'
[build]
[build.args]
NODE_VERSION = '18'
PHP_VERSION = '8.3'
[env]
APP_ENV = 'production'
APP_URL='https://the-wordsmiths-collection.fly.dev'
DB_CONNECTION="pgsql"
LOG_CHANNEL = 'stderr'
LOG_LEVEL = 'info'
LOG_STDERR_FORMATTER = 'Monolog\Formatter\JsonFormatter'
SESSION_DRIVER = 'cookie'
SESSION_SECURE_COOKIE = 'true'
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[mounts]
source="storage_vol"
destination="/var/www/html/storage"
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
Here is my GitHub repository for the project, if it helps.