Skip to content

Commit

Permalink
added a simple remotecv recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoav committed Jul 8, 2018
1 parent 9af4099 commit 6884450
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions recipes/docker-compose/remotecv/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
version: '3'
services:
thumbor:
image: minimalcompact/thumbor
environment:
# VIRTUAL_HOST is picked up by nginx-proxy. Here it's set for localhost
# but you usually need to point it to your domain, e.g. thumbor.example.com
- VIRTUAL_HOST=localhost
# THUMBOR_NUM_PROCESSES control how many processes run inside the container
# Normally this is set in connection with the number of CPU cores
# Note however that you can also use the docker-compose scale option to dynamically
# scale your thumbor instances
- THUMBOR_NUM_PROCESSES=4
# this would allow CORS from any origin (you can restrict to specific origins if you want)
- CORS_ALLOW_ORIGIN=*
# returns a webp image if browser Accept headers match
- AUTO_WEBP=True
# Basic thumbor setup to cache both original images and results (after manipulation)
# nginx-proxy would detect if there's a cached version and serve it for you automatically
# (this greatly speeds up and saves on CPU)
- RESULT_STORAGE=thumbor.result_storages.file_storage
- RESULT_STORAGE_STORES_UNSAFE=True
# setting mixed storage, and detector storage using redis
- STORAGE=thumbor.storages.mixed_storage
- MIXED_STORAGE_DETECTOR_STORAGE=tc_redis.storages.redis_storage
# using queued_complete_detector which uses all available detectors
- DETECTORS=['thumbor.detectors.queued_detector.queued_complete_detector']
# redis settings for storage and queue
- 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
volumes:
# mounting a /data folder to store cached images
- ./data:/data
links:
- redis:redis
restart: always
networks:
- app
nginx-proxy:
image: minimalcompact/thumbor-nginx-proxy
environment:
# setting the DEFAULT_HOST to the same as the VIRTUAL_HOST above.
# Makes sure it works irrespective of the host name
# Normally this won't be necessary, but it helps for testing.
- DEFAULT_HOST=localhost
volumes:
# this is essential for nginx-proxy to detect docker containers, scaling etc
# see https://github.com/jwilder/nginx-proxy
- /var/run/docker.sock:/tmp/docker.sock:ro
# mapping the same data folder, to allow nginx-proxy to fetch images from cache
- ./data:/data
ports:
- "80:80"
- "443:443"
restart: always
networks:
- app
remotecv:
image: minimalcompact/remotecv
environment:
# same settings as for thumbor, above
- REMOTECV_REDIS_HOST=redis
- REMOTECV_REDIS_PORT=6379
- REMOTECV_REDIS_DATABASE=0
deploy:
replicas: 1
links:
- redis:redis
restart: always
networks:
- app
redis:
image: redis:latest
deploy:
replicas: 1
restart: always
networks:
- app
volumes:
data:
driver: local
networks:
app:
driver: bridge

0 comments on commit 6884450

Please sign in to comment.