Lightweight CDN server (NGINX) for S3-Backend (e.g. minio)
Docker: https://hub.docker.com/r/indece/s3-cdn
Inspired by https://github.com/silinternational/docker-sync-with-s3
With Amazon AWS:
docker run -p 8080:8080 -e ACCESS_KEY=my-accesskey -e SECRET_KEY=my-secretkey -e SOURCE_PATH='s3://my-s3-bucket/' indece/s3-cdn:latest
With Minio:
docker run -p 8080:8080 -e ACCESS_KEY=my-accesskey -e SECRET_KEY=my-secretkey -e SOURCE_PATH='s3://my-s3-bucket/' -e S3SYNC_ARGS="--endpoint-url=http://myminioserver:9000" indece/s3-cdn:latest
Opens a port on 8080 and serves the files from the bucket
Important: Clones all files from the SOURCE_PATH
to /data
, even if a file is not accessed via HTTP.
Variable | Required | Default | Description |
---|---|---|---|
ACCESS_KEY | yes | S3-Access-Key | |
SECRET_KEY | yes | S3-Secret-Key | |
SOURCE_PATH | yes | Source-Path for s3 sync (e.g. 's3://my-bucket-name/') | |
INTERVAL | "15m" | Interval for s3 sync | |
S3SYNC_ARGS | "" | Extra options passed to aws-cli for s3 sync |
The path /health
always returns 200 ok
when nginx is running (this doesn't verify if the s3-sync is ok).