Giter Club home page Giter Club logo

website-mirror's Introduction

Website Mirror with Cache (GitHub)

Run mirror with cache for any website, useful for packaging registry, eg: PyPI, NPM.

Environment variable Default value description
CACHE_MAX_SIZE 10g (10 GB) Cache storage size
CACHE_INACTIVE 180d (180 days) Cached data will removed when inactive
CACHE_KEYS_ZONE_SIZE 50m (50 MB) Nginx keys_zone, 1MB zone can store about 8K keys
CACHE_VALID 10m (10 minutes) Unconditional cache time, will fallback to HTTP cache-control / ETags when expired
PEER_MIRROR_URL https://pypi.doubanio.com or https://registry.npmmirror.com Peer mirror url, request will first try peer then fallback to official registry
PEER_MIRROR_HOST pypi.doubanio.com or registry.npmmirror.com Peer mirror host

Usage: PyPI mirror

docker volume create pypi-mirror-volume
docker rm -f pypi-mirror
docker run -d \
    --name pypi-mirror \
    --restart unless-stopped \
    --log-driver json-file --log-opt max-size=50m --log-opt max-file=10 \
    --memory=500M \
    --cpus=0.5 \
    -p 127.0.0.1:8001:80 \
    -v pypi-mirror-volume:/data \
    guyskk/pypi-mirror:latest-amd64
docker logs --tail 100 -f pypi-mirror
pip install cowsay -i http://127.0.0.1:8001/simple/

Usage: NPM mirror

docker volume create npm-mirror-volume
docker rm -f npm-mirror
docker run -d \
    --name npm-mirror \
    --restart unless-stopped \
    --log-driver json-file --log-opt max-size=50m --log-opt max-file=10 \
    --memory=500M \
    --cpus=0.5 \
    -p 127.0.0.1:8002:80 \
    -v npm-mirror-volume:/data \
    guyskk/npm-mirror:latest-amd64
docker logs --tail 100 -f npm-mirror
npm install lodash --registry=http://127.0.0.1:8002

References

website-mirror's People

Contributors

guyskk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.