# 搭建 PyPi Server ###### tags: `Infrastructure` Step 1: Set a `docker-compose_pypi.yml`: ```yaml= version: '3.9' services: pypi-server: image: pypiserver/pypiserver:latest container_name: qnap_ai_pypi ports: - 8080:8080 volumes: - type: volume source: pypi-server-volume target: /data/packages command: -P . -a . /data/packages restart: always volumes: pypi-server-volume: ``` Step 2: Run Docker Compose ```shell= docker compose -f docker-compose-pypi.yml -p pypi up -d --build ``` Step 3: Prepare another Python Docker Enviornment: ```shell= docker run -itd --name python_packages -v $PWD:/root/ python:3.8 cd /root/ mkdir /home/packages pip install twine ``` Step 4: Download Python packages to local ```shell= pip download -d /home/packages -r /root/requirements.txt ``` Step 5: Upload Python packages to PyPi Server ```shell= twine upload --repository-url http://<IP>:8080 /home/packages/* --skip-existing ``` Step 6: Install Python packages from PyPi Server ```shell= pip install --index-url http://<IP>:8080 -r requirements.txt --trusted-host <IP> ``` For example: ```shell= pip install --no-cache-dir --index-url http://172.17.34.155:8080 -r requirements_gpu.txt --trusted-host 172.17.34.155 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up