Skip to content

Instantly share code, notes, and snippets.

@tgalopin
Created July 3, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgalopin/4101e879c21c025e05bf5794ffe61001 to your computer and use it in GitHub Desktop.
Save tgalopin/4101e879c21c025e05bf5794ffe61001 to your computer and use it in GitHub Desktop.
services:
digitalocean_spaces_client:
class: 'AsyncAws\S3\S3Client'
arguments: # ...
flysystem:
storages:
cdn.storage.memory:
adapter: 'memory'
cdn.storage.digitalocean:
adapter: 'asyncaws'
options:
client: 'digitalocean_spaces_client'
bucket: '%env(DIGITALOCEAN_SPACES_BUCKET)%'
cdn.storage.local:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/storage/cdn'
cdn.storage:
adapter: 'lazy'
options:
source: '%env(APP_CDN_STORAGE)%'
# Then in .env:
# APP_CDN_STORAGE=cdn.storage.local
# In .env.test:
# APP_CDN_STORAGE=cdn.storage.memory
# And in prod:
# APP_CDN_STORAGE=cdn.storage.digitalocean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment