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

Commit

Permalink
Examples revision
Browse files Browse the repository at this point in the history
  • Loading branch information
psyduck787 committed Jun 10, 2016
1 parent f86abcf commit 8a24177
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 0 deletions.
32 changes: 32 additions & 0 deletions configuration_examples/aws_beanstalk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From: https://github.com/APSL/docker-thumbor/issues/12#issuecomment-191765018
By @bf: https://github.com/bf

For AWS Beanstalk you need to create a `Dockerun.aws.json` file with the following contents. Create a new Beanstalk environment and simply upload the JSON file.

```
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "apsl/thumbor"
},
"Ports": [
{
"ContainerPort": "8000"
}
]
}
```

As soon as the new environment is booted, you need to go to the configuration section where you can set the environment parameters for the docker container. There you should define the following environment variables to serve files from your AWS S3 Bucket through thumbor to your users (all environment params are listed on https://hub.docker.com/r/apsl/thumbor/ ).

```
AWS_ACCESS_KEY_ID=XXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXX
LOADER=tc_aws.loaders.s3_loader
S3_USE_SIGV4=True
TC_AWS_LOADER_BUCKET=bucket-name
TC_AWS_REGION=eu-central-1
```

If you want to store the files resized by thumbor on S3 as well, you need to add some more evironment params. We use a caching server in front of thumbor which solves the need for caching of result files in S3.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: remotecv-production
labels:
app: remotecv-production
version: "latest"
spec:
replicas: 2
selector:
app: remotecv-production
version: "latest"
template:
metadata:
generateName: remotecv-production-pod-
labels:
app: remotecv-production
version: "latest"
spec:
containers:
- name: remotecv
image: apsl/remotecv:latest
env:
- name: REDIS_HOST
value: redis
- name: REDIS_PORT
value: "6379"
- name: REDIS_DATABASE
value: "11"
- name: AWS_ACCESS_KEY_ID
value: "MY_AWS_ACCESS_KEY_ID"
- name: AWS_SECRET_ACCESS_KEY
value: "MY_AWS_SECRET_ACCESS_KEY"
- name: AWS_LOADER_BUCKET
value: "thumbor-production"
- name: REMOTECV_LOADER
value: "remotecv_aws.loader"
#- name: LOG_LEVEL
#value: "DEBUG"
resources:
limits:
cpu: 600m
memory: 1200Mi
requests:
cpu: 10m
memory: 10Mi
imagePullPolicy: Always
restartPolicy: Always
dnsPolicy: ClusterFirst

111 changes: 111 additions & 0 deletions configuration_examples/google_cloud_engine/production/thumbor-rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: thumbor-prod
labels:
app: thumbor-prod
version: "latest"
spec:
replicas: 4
selector:
app: thumbor-prod
version: "latest"
template:
metadata:
name: thumbor-prod
labels:
app: thumbor-prod
version: "latest"
role: service
group: yourgroup
spec:
containers:
- name: thumbor-prod
image: apsl/thumbor:latest
resources:
limits:
cpu: 600m
memory: 1200Mi
requests:
cpu: 10m
memory: 10Mi
env:
- name: LOG_LEVEL
value: "DEBUG"
- name: ALLOW_UNSAFE_URL
value: "False"
- name: SECURITY_KEY
value: "MY_SECURITY_KEY"
- name: DETECTORS
value: "['thumbor.detectors.queued_detector.queued_complete_detector',]"
- name: RESULT_STORAGE
value: "thumbor.result_storages.file_storage"
- name: REDIS_STORAGE_SERVER_HOST
value: redis
- name: REDIS_STORAGE_SERVER_PORT
value: "6379"
- name: REDIS_STORAGE_SERVER_DB
value: "11"
- name: REDIS_QUEUE_SERVER_HOST
value: redis
- name: REDIS_QUEUE_SERVER_PORT
value: "6379"
- name: REDIS_QUEUE_SERVER_DB
value: "11"
- name: STORAGE
value: "thumbor.storages.mixed_storage"
- name: MIXED_STORAGE_DETECTOR_STORAGE
value: "thumbor.storages.redis_storage"
- name: MIXED_STORAGE_FILE_STORAGE
value: "thumbor.storages.file_storage"
#- name: THUMBOR_NUM_PROCESSES
#value: "8"
- name: LOADER
value: "tc_aws.loaders.s3_loader"
- name: AWS_ACCESS_KEY_ID
value: "MY_AWS_ACCESS_KEY_ID"
- name: AWS_SECRET_ACCESS_KEY
value: "MY_AWS_SECRET_ACCESS_KEY"
- name: TC_AWS_LOADER_BUCKET
value: "thumbor-production"
- name: THUMBOR_PORT
value: "8001"
- name: STORAGE_EXPIRATION_SECONDS
value: "None"
- name: RESULT_STORAGE_EXPIRATION_SECONDS
value: "None"
- name: RESPECT_ORIENTATION
value: "True"
volumeMounts:
- name: thumbor-prod-data
mountPath: /data
readOnly: False
imagePullPolicy: Always
- name: thumbor-prod-nginx
image: apsl/thumbor-nginx:latest
resources:
limits:
cpu: 100m
memory: 50Mi
requests:
cpu: 10m
memory: 5Mi
env:
- name: THUMBOR_DEFAULT_HOST
value: 127.0.0.1
- name: THUMBOR_DEFAULT_PORT
value: "8001"
ports:
- containerPort: 80
name: thumbor-prod
volumeMounts:
- name: thumbor-prod-data
mountPath: /data
readOnly: True
imagePullPolicy: Always
volumes:
- name: thumbor-prod-data
hostPath:
path: /var/thumbor-production
restartPolicy: Always
dnsPolicy: ClusterFirst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: thumbor-prod
labels:
app: thumbor-prod
spec:
type: NodePort
ports:
- port: 80
targetPort: thumbor-prod
name: thumbor-prod
selector:
app: thumbor-prod

0 comments on commit 8a24177

Please sign in to comment.