Skip to content

Instantly share code, notes, and snippets.

@kumekay
Created July 10, 2025 19:50
Show Gist options
  • Save kumekay/ca35a4adec84538e8c4929665405efed to your computer and use it in GitHub Desktop.
Save kumekay/ca35a4adec84538e8c4929665405efed to your computer and use it in GitHub Desktop.
ESP Component Registry Mirror

Read-only ESP Component Registry Mirror

A docker-compose example for running a read-only mirror of the ESP Component Registry. The docker-compose file consists of 2 services:

  • sync - periodically synchronize AWS S3 bucket with local storage
  • web - an instance of Nginx to serve the files through HTTP

Running locally

  1. Clone this repo
  2. Update environment variables if needed
  3. Run docker-compose up -d
  4. Set IDF_COMPONENT_STORAGE_URL environment variable to the Nginx
  5. Check that DEFAULT_COMPONENT_SERVICE_URL is not set

Expected Environment Variables

  1. AWS_ENDPOINT_URL - (optional) URL of the AWS (AWS URL by default)
  2. AWS_BUCKET_NAME - (optional) S3 Bucket name (idf-components-prod by default)
  3. SCRIPT_SLEEP_TIME_IN_SECONDS - (optional) Do sync after that time (7200 seconds by default)
version: "3"
services:
sync:
image: amazon/aws-cli:2.7.32
entrypoint: bash -c "set -e; while true; do aws --no-sign-request --region "ap-east-1" ${AWS_ENDPOINT_URL:+--endpoint-url $AWS_ENDPOINT_URL} s3 sync "s3://${AWS_BUCKET_NAME:-idf-components-prod}/" "/files/" --delete; sleep "${SCRIPT_SLEEP_TIME_IN_SECONDS:-7200}"; done"
restart: unless-stopped
volumes:
- files-volume:/files
web:
image: nginx:1-alpine
ports:
- "80:80"
restart: unless-stopped
volumes:
- files-volume:/usr/share/nginx/html
volumes:
files-volume:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment