Skip to content

Instantly share code, notes, and snippets.

@rhee-elten
Last active September 7, 2023 00:50
Show Gist options
  • Save rhee-elten/70f871aed2fdbeec12979636ab815454 to your computer and use it in GitHub Desktop.
Save rhee-elten/70f871aed2fdbeec12979636ab815454 to your computer and use it in GitHub Desktop.
:
<<EEE >/dev/null
https://github.com/EpicWink/proxpi
Environment variables
PROXPI_INDEX_URL: index URL, default: https://pypi.org/simple/
PROXPI_INDEX_TTL: index cache time-to-live in seconds, default: 30 minutes. Disable index-cache by setting this to 0
PROXPI_EXTRA_INDEX_URLS: extra index URLs (comma-separated)
PROXPI_EXTRA_INDEX_TTLS: corresponding extra index cache times-to-live in seconds (comma-separated), default: 3 minutes, cache disabled when 0
PROXPI_CACHE_SIZE: size of downloaded project files cache (bytes), default 5GB. Disable files-cache by setting this to 0
PROXPI_CACHE_DIR: downloaded project files cache directory path, default: a new temporary directory
PROXPI_BINARY_FILE_MIME_TYPE=1: force file-response content-type to "application/octet-stream" instead of letting Flask guess it. This may be needed if your package installer (eg Poetry) mishandles responses with declared encoding.
PROXPI_DISABLE_INDEX_SSL_VERIFICATION=1: don't verify any index SSL certificates
PROXPI_DOWNLOAD_TIMEOUT: time (in seconds) before proxpi will redirect to the proxied index server for file downloads instead of waiting for the download, default: 0.9
EEE
docker run -dit --restart unless-stopped \
-p 5050:5000 \
-u 1000:1000 \
-v /etc/localtime:/etc/localtime:ro \
-v /var/cache/proxpi/data:/data \
-e PROXPI_EXTRA_INDEX_URLS="https://download.pytorch.org/whl/cu118,https://pypi.tuna.tsinghua.edu.cn/simple,https://pypi.ngc.nvidia.com" \
-e PROXPI_CACHE_DIR=/data \
--name proxpi epicwink/proxpi:v1.2.0a1
cat <<EEE 1>&2
config your ~/.config/pip/pip.conf:
[global]
no-cache-dir = true
index-url = http://127.0.0.1:5050/index
trusted-host = 127.0.0.1
EEE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment