Simple Thumbor Docker image that serves image files from an AWS S3 bucket,
using the ImageMagick engine. To run, supply the following environment
variables for docker run:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_S3_BUCKETTHUMBOR_KEY
- Prepare an environment file such as
thumbor.envwith the following content:
AWS_ACCESS_KEY_ID=<your AWS access key ID>
AWS_SECRET_ACCESS_KEY=<your AWS secret access key>
AWS_S3_BUCKET=<your s3 bucket>
THUMBOR_KEY=<your Thumbor key>
docker run --name thumbor -p "8888:8888" --env-file=thumbor.env 9gel/thumbor-s3- Get a URL for a file
yourfile.png:docker exec thumbor thumbor-url -k '<your Thumbor key>' -w 400 -e 400 "yourfile.png"- You'll get a URL like:
/<generated signature>/400x400/yourfile.png
- Access the file:
http://<your docker host>:8888/<generated signature>/400x400/yourfile.png
Launch a few Thumbor executables per machine, and put Nginx in front.
With Docker Compose
Here's an example using Docker Compose with files in this repository:
- Edit thumbor.env to fill in your specifics
docker-compose up- You should see the container names. One of those for Thumbor will look like
dockerthumbors3_thumbor1_1
- You should see the container names. One of those for Thumbor will look like
- Get a URL for a file
yourfile.png:docker exec dockerthumbors3_thumbor1_1 thumbor-url -k '<your Thumbor key>' -w 400 -e 400 "yourfile.png"- You'll get a URL like:
/<generated signature>/400x400/yourfile.png
- Access the file:
http://<your docker host>:8880/<generated signature>/400x400/yourfile.png
Easily deploy to Amazon Elastic Beanstalk in a Multicontainer Docker Environment and take advantage of their auto-scaling feature. You can also put a CDN in front of your setup with CloudFront.
- Follow this Elastic Beanstalk tutorial, using the
Dockerrun.aws.jsonin this repository. - Define these Environment Properties in Elastic Beanstalk Configuration -> Software Configuration
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_S3_BUCKET
THUMBOR_KEY
The ENTRYPOINT script:
- Takes the
thumbor.conf.tpltemplate and produces/etc/thumbor.confwith environment variables using 'envtpl'. - Runs
thumbor