- Install latest
docker-ce
(17.12.0-ce) anddocker-compose
(1.18.0) - Setup nginx-proxy, or docker-compose-letsencrypt-nginx-proxy-companion
- Ensure
nginx-network
exists and used by nginx-proxy:docker network create --attachable --driver overlay --subnet 10.10.10.10/24 nginx-network
- Clone:
git clone https://github.com/night-crawler/devpi-docker/
cd devpi-docker
- Tune environment:
cp .env.sample .env
docker-compose up
- Add
devpi.test
(or whatever) to/etc/hosts
[global]
index-url = http://devpi.test/root/pypi/+simple/
[search]
index = http://devpi.test/root/pypi/
[install]
trusted-host=devpi.test
[easy_install]
index_url = http://devpi.test/root/pypi/+simple/
# install devpi client
pip install devpi-client
# set devpi server
devpi use http://devpi.test
# login
devpi login root
# enter password from .env file
# set your email
devpi user -m root email=lilo.panic@gmail.com
# change password
devpi user -m root password=ChangeMePlease
# add `dev` index of main pypi
devpi index -c dev bases=root/pypi
# use index
devpi use root/dev
# install package
devpi install pytest
# or
pip install django
Let's assume volumes of docker-compose-letsencrypt-nginx-proxy-companion
are mounted to
./data
:
pwd
# /docker/docker-compose-letsencrypt-nginx-proxy-companion]
ls ./data
# certs conf.d html htpasswd vhost.d
Put into ./data/vhost.d/devpi.test_location
:
proxy_set_header X-outside-url $scheme://$host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
In mounted data volume create htpasswd/$VIRTUAL_HOST
:
cd /docker/docker-compose-letsencrypt-nginx-proxy-companion/data/htpasswd/
htpasswd -nbs user ChangeMePass >> devpi.test
Change links in your ~/.pip/pip.conf
according to scheme
http://username:password@server/whatever/
:
[global]
index-url = https://user:ChangeMePass@devpi.test/root/pypi/+simple/
[search]
index = https://user:ChangeMePass@devpi.test/root/pypi/