Skip to content

Instantly share code, notes, and snippets.

@24HOURSMEDIA
Last active January 19, 2024 17:20
Show Gist options
  • Save 24HOURSMEDIA/aec3c762b4a890756369fa3d28759f14 to your computer and use it in GitHub Desktop.
Save 24HOURSMEDIA/aec3c762b4a890756369fa3d28759f14 to your computer and use it in GitHub Desktop.
Caching proxy for S3 with SSL terminator
services:
ssl_terminator:
# ssl terminator docs: https://24hoursmedia.github.io/docker-nginx-ssl-terminator/
image: 24hoursmedia/nginx-ssl-terminator:1.2.0-nginx1.25-alpine3.18-slim
restart: always
depends_on:
- caching_proxy
ports:
- "${PUBLIC_HTTPS_PORT:-443}:12443"
environment:
- "HTTPS_PORT=12443"
- "HTTP_PORT=12080"
- "BACKEND_HOST=caching_proxy"
- "BACKEND_PORT=12001"
# these are the locations of the ssl certs, by default they
# contain self signed developer certificates.
- "SSL_CERT=/sslcerts/server.crt"
- "SSL_CERT_KEY=/sslcerts/server.key"
# mount your own server certificate and key like this:
#volumes:
# - "./mysslcert.crt:/sslcerts/server.crt"
# - "./mysslkey.key:/sslcerts/server.key"
caching_proxy:
# caching proxy docs: https://24hoursmedia.github.io/docker-cachelink-proxy/
image: 24hoursmedia/cachelink-proxy:1.0.0-nginx1.25-alpine3.18-slim
restart: always
depends_on:
- forward_proxy
ports:
- "${PUBLIC_HTTP_PORT:-443}:12001"
environment:
- "CACHE_BACKEND=http://forward_proxy:12000"
- "CACHE_PORT=12001"
- "CACHE_STRATEGY=force"
- "CACHE_TTL=600"
forward_proxy:
# forward proxy docs: https://24hoursmedia.github.io/docker-flowforward-proxy/
image: 24hoursmedia/flowforward-proxy:1.0.0-nginx1.25-alpine3.18-slim
restart: always
environment:
# replace with your own s3 bucket
- "PROXY_BACKEND=YOURS3BUCKET.s3.eu-central-1.amazonaws.com"
- "PROXY_PORT=12000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment