Open source omnivore
This commit is contained in:
20
imageproxy/Dockerfile
Normal file
20
imageproxy/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
FROM willnorris/imageproxy:v0.10.0 as build
|
||||
|
||||
# Above imageproxy image is built from scratch image and is barebones
|
||||
# Switching over to ubuntu base image to allow us to debug better.
|
||||
FROM ubuntu:bionic
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt update && apt install -y ca-certificates
|
||||
|
||||
COPY --from=build /app/imageproxy .
|
||||
|
||||
COPY start_imageproxy.sh .
|
||||
|
||||
# Using a custom script to customize imageproxy startup and to pass
|
||||
# signatureKey through env variable
|
||||
ENTRYPOINT ["/app/start_imageproxy.sh"]
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
39
imageproxy/fly.omnivore-demo-imageproxy.toml
Normal file
39
imageproxy/fly.omnivore-demo-imageproxy.toml
Normal file
@ -0,0 +1,39 @@
|
||||
# fly.toml file generated for omnivore-demo-imageproxy on 2021-09-21T14:21:15-07:00
|
||||
|
||||
app = "omnivore-demo-imageproxy"
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = 5
|
||||
processes = []
|
||||
|
||||
[env]
|
||||
|
||||
[experimental]
|
||||
allowed_public_ports = []
|
||||
auto_rollback = true
|
||||
|
||||
[[services]]
|
||||
http_checks = []
|
||||
internal_port = 8080
|
||||
processes = ["app"]
|
||||
protocol = "tcp"
|
||||
script_checks = []
|
||||
|
||||
[services.concurrency]
|
||||
hard_limit = 25
|
||||
soft_limit = 20
|
||||
type = "connections"
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[services.tcp_checks]]
|
||||
grace_period = "1s"
|
||||
interval = "15s"
|
||||
restart_limit = 6
|
||||
timeout = "2s"
|
||||
39
imageproxy/fly.omnivore-dev-imageproxy.toml
Normal file
39
imageproxy/fly.omnivore-dev-imageproxy.toml
Normal file
@ -0,0 +1,39 @@
|
||||
# fly.toml file generated for omnivore-dev-imageproxy on 2021-09-21T14:25:22-07:00
|
||||
|
||||
app = "omnivore-dev-imageproxy"
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = 5
|
||||
processes = []
|
||||
|
||||
[env]
|
||||
|
||||
[experimental]
|
||||
allowed_public_ports = []
|
||||
auto_rollback = true
|
||||
|
||||
[[services]]
|
||||
http_checks = []
|
||||
internal_port = 8080
|
||||
processes = ["app"]
|
||||
protocol = "tcp"
|
||||
script_checks = []
|
||||
|
||||
[services.concurrency]
|
||||
hard_limit = 25
|
||||
soft_limit = 20
|
||||
type = "connections"
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[services.tcp_checks]]
|
||||
grace_period = "1s"
|
||||
interval = "15s"
|
||||
restart_limit = 6
|
||||
timeout = "2s"
|
||||
39
imageproxy/fly.omnivore-prod-imageproxy.toml
Normal file
39
imageproxy/fly.omnivore-prod-imageproxy.toml
Normal file
@ -0,0 +1,39 @@
|
||||
# fly.toml file generated for omnivore-prod-imageproxy on 2021-09-21T14:27:25-07:00
|
||||
|
||||
app = "omnivore-prod-imageproxy"
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = 5
|
||||
processes = []
|
||||
|
||||
[env]
|
||||
|
||||
[experimental]
|
||||
allowed_public_ports = []
|
||||
auto_rollback = true
|
||||
|
||||
[[services]]
|
||||
http_checks = []
|
||||
internal_port = 8080
|
||||
processes = ["app"]
|
||||
protocol = "tcp"
|
||||
script_checks = []
|
||||
|
||||
[services.concurrency]
|
||||
hard_limit = 25
|
||||
soft_limit = 20
|
||||
type = "connections"
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[services.tcp_checks]]
|
||||
grace_period = "1s"
|
||||
interval = "15s"
|
||||
restart_limit = 6
|
||||
timeout = "2s"
|
||||
19
imageproxy/imageproxy-service-demo.yaml
Normal file
19
imageproxy/imageproxy-service-demo.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
runtime: custom
|
||||
service: imageproxy
|
||||
env: flex
|
||||
|
||||
automatic_scaling:
|
||||
min_num_instances: 1
|
||||
max_num_instances: 2
|
||||
|
||||
resources:
|
||||
cpu: 1
|
||||
memory_gb: 1
|
||||
disk_size_gb: 10
|
||||
|
||||
env_variables:
|
||||
GCS_IMAGES_PATH: 'gcs://omnivore-demo-files/images/'
|
||||
MEM_CACHE_SIZE_MB: 100
|
||||
|
||||
includes:
|
||||
- .secrets-imageproxy.yaml
|
||||
19
imageproxy/imageproxy-service-production.yaml
Normal file
19
imageproxy/imageproxy-service-production.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
runtime: custom
|
||||
service: imageproxy
|
||||
env: flex
|
||||
|
||||
automatic_scaling:
|
||||
min_num_instances: 1
|
||||
max_num_instances: 2
|
||||
|
||||
resources:
|
||||
cpu: 1
|
||||
memory_gb: 2
|
||||
disk_size_gb: 10
|
||||
|
||||
env_variables:
|
||||
GCS_IMAGES_PATH: 'gcs://omnivore/images/'
|
||||
MEM_CACHE_SIZE_MB: 600
|
||||
|
||||
includes:
|
||||
- .secrets-imageproxy.yaml
|
||||
19
imageproxy/imageproxy-service-qa.yaml
Normal file
19
imageproxy/imageproxy-service-qa.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
runtime: custom
|
||||
service: imageproxy
|
||||
env: flex
|
||||
|
||||
automatic_scaling:
|
||||
min_num_instances: 1
|
||||
max_num_instances: 2
|
||||
|
||||
resources:
|
||||
cpu: 1
|
||||
memory_gb: 1
|
||||
disk_size_gb: 10
|
||||
|
||||
env_variables:
|
||||
GCS_IMAGES_PATH: 'gcs://omnivore-qa-files/images/'
|
||||
MEM_CACHE_SIZE_MB: 100
|
||||
|
||||
includes:
|
||||
- .secrets-imageproxy.yaml
|
||||
17
imageproxy/start_imageproxy.sh
Executable file
17
imageproxy/start_imageproxy.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
export IMAGEPROXY_USERAGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
|
||||
|
||||
export IMAGEPROXY_SIGNATUREKEY="${IMAGE_PROXY_SECRET}"
|
||||
|
||||
if [[ ! -z ${GCS_IMAGES_PATH} && ! -z ${MEM_CACHE_SIZE_MB} ]]; then
|
||||
# ImageProxy shall rely on the credentials of the default App Engine Service
|
||||
# Account. For the GCS bucket path access here to ImageProxy, we must grant
|
||||
# Storage object creator/view access on the bucket to the default app engine
|
||||
# service account in the project.
|
||||
/app/imageproxy -verbose -timeout 60s -cache memory:${MEM_CACHE_SIZE_MB} -cache ${GCS_IMAGES_PATH} -addr 0.0.0.0:8080
|
||||
else
|
||||
# Running locally, use memory cache only
|
||||
/app/imageproxy -verbose -timeout 60s -cache memory:1000 -addr 0.0.0.0:8080
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user