beeyev / thumbor-s3-docker Goto Github PK
View Code? Open in Web Editor NEWA docker image for thumbor with AWS S3 / Minio integration for cropping, resizing, applying filters and optimizing images on the fly.
License: MIT License
A docker image for thumbor with AWS S3 / Minio integration for cropping, resizing, applying filters and optimizing images on the fly.
License: MIT License
i have 3 buckets in minio, how to config in thumbor??
Is it possible to get docker images supporting ARM platforms?
Getting the following message:
"! thumbor The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)"
The thumbor-video-engine can get video frames,it is very important in
image preview service
I'm using the image beeyev/thumbor-s3:7.4-alpine
.
Thanks for providing the example with MinIO. Thumbor works as expected with MinIO with the following configuration:
LOG_LEVEL=info
LOADER=thumbor_aws.loader
AWS_LOADER_REGION_NAME=local
AWS_LOADER_BUCKET_NAME=awesome-bucket-img
AWS_LOADER_S3_ACCESS_KEY_ID=oc
AWS_LOADER_S3_SECRET_ACCESS_KEY=changeme
AWS_LOADER_S3_ENDPOINT_URL=http://minio:9000
AWS_LOADER_ROOT_PATH=/img
RESULT_STORAGE=thumbor_aws.result_storage
AWS_RESULT_STORAGE_REGION_NAME=local
AWS_RESULT_STORAGE_BUCKET_NAME=awesome-bucket-img-cache
AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID=oc
AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY=changeme
AWS_RESULT_STORAGE_S3_ENDPOINT_URL=http://minio:9000
AWS_RESULT_STORAGE_ROOT_PATH=/img-cache
RESULT_STORAGE_STORES_UNSAFE=True
RESULT_STORAGE_EXPIRATION_SECONDS=2629746
# SECURITY_KEY=changeme
ALLOW_UNSAFE_URL=True
QUALITY=80
MAX_AGE=86400
AUTO_PNG_TO_JPG=True
HTTP_LOADER_VALIDATE_CERTS=False
I'm now trying to use two AWS S3 bucket with the following config (minus the secrets of the IAM user):
LOG_LEVEL=info
LOADER=thumbor_aws.loader
AWS_LOADER_REGION_NAME=us-east-1
AWS_LOADER_BUCKET_NAME=awesome-bucket-img
AWS_LOADER_S3_ACCESS_KEY_ID=
AWS_LOADER_S3_SECRET_ACCESS_KEY=
AWS_LOADER_S3_ENDPOINT_URL=http://awesome-bucket-img.s3-website-us-east-1.amazonaws.com
AWS_LOADER_ROOT_PATH=/img
RESULT_STORAGE=thumbor_aws.result_storage
AWS_RESULT_STORAGE_REGION_NAME=us-east-1
AWS_RESULT_STORAGE_BUCKET_NAME=awesome-bucket-img-cache
AWS_RESULT_STORAGE_S3_ACCESS_KEY_ID=
AWS_RESULT_STORAGE_S3_SECRET_ACCESS_KEY=
AWS_RESULT_STORAGE_S3_ENDPOINT_URL=http://awesome-bucket-img-cache.s3-website-us-east-1.amazonaws.com
AWS_RESULT_STORAGE_ROOT_PATH=/img-cache
RESULT_STORAGE_STORES_UNSAFE=True
RESULT_STORAGE_EXPIRATION_SECONDS=2629746
# SECURITY_KEY=changeme
ALLOW_UNSAFE_URL=True
QUALITY=80
MAX_AGE=86400
AUTO_PNG_TO_JPG=True
HTTP_LOADER_VALIDATE_CERTS=False
Here is the policy I use to allow the Thumbor IAM user to read from awesome-bucket-img
and read/write to the bucket awesome-bucket-img-cache
.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject*"
],
"Resource": [
"arn:aws:s3:::awesome-bucket-img",
"arn:aws:s3:::awesome-bucket-img/*",
"arn:aws:s3:::awesome-bucket-img-cache",
"arn:aws:s3:::awesome-bucket-img-cache/*"
]
},
{
"Effect": "Allow",
"Action": "s3:*Object",
"Resource": [
"arn:aws:s3:::awesome-bucket-img-cache/*"
]
}
]
}
Thumbor fails to get the image from the AWS bucket with the following error:
File "/usr/local/lib/python3.10/site-packages/thumbor/handlers/__init__.py", line 212, in get_image
result = await self._fetch(self.context.request.image_url)
File "/usr/local/lib/python3.10/site-packages/thumbor/handlers/__init__.py", line 884, in _fetch
loader_result = await self.context.modules.loader.load(
File "/usr/local/lib/python3.10/site-packages/thumbor_aws/loader.py", line 89, in load
status_code, body, last_modified = await client.get_data(
File "/usr/local/lib/python3.10/site-packages/thumbor_aws/s3_client.py", line 143, in get_data
response = await client.get_object(Bucket=bucket, Key=path)
File "/usr/local/lib/python3.10/site-packages/aiobotocore/client.py", line 371, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred () when calling the GetObject operation:
2023-03-21 02:23:04 thumbor:ERROR [BaseHandler] get_image failed for url `triforce.png`. error: `An error occurred () when calling the GetObject operation: `
2023-03-21 02:23:04 tornado.access:ERROR 500 GET /unsafe/triforce.png (172.21.0.1) 213.96ms
For some reason the boto client does not provide details about the error (no error code or reason).
Do you have thoughts on why Thumbor can not read the image from the AWS S3 bucket?
Thanks for having created this Thumbor image!
Does it support STORAGE and STORAGE_ RESULT??
if supported, how to config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.