Whether you're looking to save money on egress charges or whether you simply want a local cache of a subset of your S3 bucket, all you need is this docker compose configuration to proxy all your read requests and cache files locally.
version: '3.7'
services:
minio1:
image: minio/minio:latest
hostname: minio1
volumes:
- ./local_cache:/data1
ports:
- "9000:9000"
environment:
MINIO_ROOT_USER: ACCESS_KEY_HERE
MINIO_ROOT_PASSWORD: SECRET_KEY_HERE
MINIO_CACHE: "on"
MINIO_CACHE_DRIVES: /data1
MINIO_CACHE_QUOTA: 90
MINIO_CACHE_AFTER: 0
MINIO_CACHE_WATERMARK_LOW: 70
MINIO_CACHE_WATERMARK_HIGH: 90
command: gateway s3 https://my-custom-s3.domain.com
Tune as you please. Find more information here: https://docs.min.io/docs/minio-disk-cache-guide.html and here: https://docs.min.io/docs/minio-gateway-for-s3.html
You might want to reverse proxy it. It's not necessary but if you want here is a simple caddy v2 configuration:
s3cache.mycustomdomain.com {
reverse_proxy localhost:9000
tls [email protected]
}
simply bring the container up with docker-compose up -d
You're all set, enjoy spending less :)