Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Doc revision
Browse files Browse the repository at this point in the history
  • Loading branch information
psyduck787 committed Feb 17, 2016
1 parent 6f7c4a2 commit ce802b9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 94 deletions.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Minimal Usage
================
```
$ docker run -p 8000:80 apsl/thumbor
$ docker run -p 8000:8000 apsl/thumbor
$ wget http://localhost:8000/unsafe/300x300/i.imgur.com/bvjzPct.jpg
```

Docker thumbor and remotecv
========================

[![Build Status](https://travis-ci.org/APSL/docker-thumbor.svg?branch=travis)](https://travis-ci.org/APSL/docker-thumbor)
[![Build Status](https://travis-ci.org/APSL/docker-thumbor.svg?branch=master)](https://travis-ci.org/APSL/docker-thumbor)

Docker image for thumbor, and separated one for remotecv, necessary for the lazy detection.
All parameters of the thumbor config can be set with env vars.
The thumbor's docker expose port 80 with the service.
The thumbor's docker expose port 8000 with the service.
Consider to use the docker-thumbor-nginx image to use nginx like a first cache.
The nginx cache check if the file exists in a shared volume (file_storage) after to send the request to thumbor (automated failover).
We propose two thumbor images aspl/thumbor and apsl/thumbor-multiprocess.
Expand All @@ -28,25 +28,25 @@ Docker thumbor image
* Opencv detectors
* Optimizer JPEG included
* Nginx cache to optimize the server of result images in a separated docker image
* Separated remotecv docker image
* Separated remotecv docker image, with AWS S3 loader support.
* Use the official python images and best practices
* A lot of docker-compose examples with tipical uses cases
* envtpl to setup config files on start time, based on environ vars. https://github.com/andreasjansson/envtpl

Ports
=====

* 80: thumbor
* 8000: thumbor

Docker-compose examples
=======================

Check the docker-compose examples:

* [Simple detection](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-detector.yml)
* [Lazy detection using redis](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-lazy-detector.yml)
* [AWS S3 storage](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-aws-s3-storage.yml)
* [Proposed use in production](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-production.yml)
* [Simple detection](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-examples/detector.yml)
* [Lazy detection using redis](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-examples/lazy-detector.yml)
* [AWS S3 storage](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-examples/aws-s3-storage.yml)
* [Proposed use in production, reading from a AWS S3 and local cache of storage/result_storage](https://github.com/APSL/docker-thumbor/blob/master/docker-compose-examples/production.yml)


[![Deploy to Tutum](https://s.tutum.co/deploy-to-tutum.svg)](https://dashboard.tutum.co/stack/deploy/)
Expand Down Expand Up @@ -74,12 +74,8 @@ Env vars and default value:
USE_BLACKLIST=False
LOADER='thumbor.loaders.http_loader'
STORAGE='thumbor.storages.file_storage'
STORAGE_BUCKET='' -> -> Note: old config to use with thumbor_aws storage. Not for tc_aws
RESULT_STORAGE_BUCKET='' -> -> Note: old config to use with thumbor_aws storage. Not for tc_aws
AWS_ACCESS_KEY='' -> Note: old config to use with thumbor_aws storage. Not for tc_aws
AWS_SECRET_KEY='' -> Note: old config to use with thumbor_aws storage. Not for tc_aws
AWS_ACCESS_KEY_ID='' -> Note: New config to use with tc_aws only
AWS_SECRET_ACCESS_KEY='' -> Note: New config to use with tc_aws only
AWS_ACCESS_KEY_ID='' -> Note: New in version 5.2.1c
AWS_SECRET_ACCESS_KEY='' -> Note: New in version 5.2.1c
RESULT_STORAGE='thumbor.result_storages.file_storage'
ENGINE='thumbor.engines.pil'
SECURITY_KEY='MY_SECURE_KEY'
Expand All @@ -91,7 +87,7 @@ Env vars and default value:
HTTP_LOADER_FOLLOW_REDIRECTS=True
HTTP_LOADER_MAX_REDIRECTS=5
HTTP_LOADER_FORWARD_USER_AGENT=False
HTTP_LOADER_DEFAULT_USER_AGENT='Thumbor/5.0.3'
HTTP_LOADER_DEFAULT_USER_AGENT='Thumbor/5.2.1'
HTTP_LOADER_PROXY_HOST=None
HTTP_LOADER_PROXY_PORT=None
HTTP_LOADER_PROXY_USERNAME=None
Expand Down
28 changes: 3 additions & 25 deletions TODOs
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
New requirements v2
New requirements v3

Thumbor
- Official python image
- Remove nginx
- Remove user app, use root instead
- No virtualenv
- ¿Remove circus?
- Securize critical env vars: thumbor key
- Env file
- Way to config the number of thumbor proceses running inside the container

Remotecv
- Official python image
- ¿Remove circus?
- Update las version (change name)

Nginx
- Volumes from thumbor
- Check image in volume and failover (possible?)

Redis
- Secrets

Document results analized of service with tests like:
# Stress test in localhost
ab -n 1000 -c 5 http://localhost:8000/unsafe/600x500/static.goal.com/749100/749122_heroa.jpg
Without result storage , without nginx: 32
With result storage , without nginx: 748
With result storage , with nginx: 5237


python
python-dev
python-distribute
python-pip
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
thumbor:
image: apsl/thumbor-multiprocess:latest
image: apsl/thumbor:latest
volumes:
- ./data:/data
- ./logs:/logs
#ports:
#- "80:8000" # thumbor port
- ./data:/data
environment:
ALLOW_UNSAFE_URL: False
DETECTORS: ['thumbor.detectors.queued_detector.queued_complete_detector',]
AWS_ACCESS_KEY_ID: # put your AWS_ACCESS_KEY here
AWS_SECRET_ACCESS_KEY: # put your AWS_SECRET_ACCESS_KEY here
TC_AWS_LOADER_BUCKET: bucket-name
LOADER: tc_aws.loaders.s3_loader
SECURITY_KEY: SECURIZE_ME
DETECTORS: "['thumbor.detectors.queued_detector.queued_complete_detector',]"
AWS_ACCESS_KEY: # put your AWS_ACCESS_KEY here
AWS_SECRET_KEY: # put your AWS_SECRET_KEY here
#LOG_LEVEL: debug
STORAGE: thumbor.storages.mixed_storage
STORAGE_BUCKET: storage-bucket-name
UPLOAD_PHOTO_STORAGE: thumbor_aws.storages.s3_storage
MIXED_STORAGE_FILE_STORAGE: thumbor_aws.storages.s3_storage
MIXED_STORAGE_FILE_STORAGE: thumbor.storages.file_storage
RESULT_STORAGE: thumbor.result_storages.file_storage
REDIS_STORAGE_SERVER_HOST: redis
REDIS_STORAGE_SERVER_PORT: 6379
REDIS_STORAGE_SERVER_DB: 0
REDIS_QUEUE_SERVER_HOST: redis
REDIS_QUEUE_SERVER_PORT: 6379
REDIS_QUEUE_SERVER_DB: 0
STORAGE_EXPIRATION_SECONDS: None
RESULT_STORAGE_EXPIRATION_SECONDS: None
MIXED_STORAGE_DETECTOR_STORAGE: thumbor.storages.redis_storage
SENTRY_DSN_URL: # put your sentry enpoint here
THUMBOR_NUM_PROCESSES: 16
links:
- redis:redis
restart: always
nginx:
image: apsl/thumbor-nginx:latest
links:
Expand All @@ -44,6 +45,13 @@ remotecv:
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_DATABASE: 0
SENTRY_URL: # put your sentry enpoint here
LOADER: remotecv_aws.loader
AWS_ACCESS_KEY_ID: # put your AWS_ACCESS_KEY here
AWS_SECRET_ACCESS_KEY: # put your AWS_SECRET_ACCESS_KEY here
AWS_LOADER_BUCKET: bucket-name
#LOG_LEVEL: DEBUG
restart: always
redis:
image: redis:latest

restart: always
40 changes: 0 additions & 40 deletions docker-compose-s3-result-storage.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
thumbor:
build: thumbor-multiprocess
build: thumbor
environment:
RESULT_STORAGE: thumbor.result_storages.file_storage
RESULT_STORAGE_STORES_UNSAFE: True
Expand Down

0 comments on commit ce802b9

Please sign in to comment.