-
Notifications
You must be signed in to change notification settings - Fork 2
HOWTO Store files in S3
Justin Forest edited this page May 15, 2024
·
7 revisions
Tree photos take a lot of space. A single photo can take around 4-5 Mb. A site with many trees can require a lot of disk space, which might not be available or might not be cheap at the hosting server. It is more convenient to use an S3 compatible file storage.
When an S3 compatible storage is used, files are stored in that storage, and read from there, bypassing the local file system altogether.
To enable the S3 file storage, the following environment variables need to be defined:
AWS_ACCESS_KEY_ID=secret
AWS_SECRET_ACCESS_KEY=secret
S3_BUCKET=treemap1-bucket
S3_REGION=fra1
S3_ENDPOINT=https://fra1.digitaloceanspaces.com
If the site was previously running with the local storage, those files can be moved to S3 (after the remote storage is successfully configured) using the following command:
treemap upload-files