Container that runs a private PyPI with basic authentication.
124
This container runs a PyPI server on port 8080. A volume or bind mount should be attached to /data which contains two items:
htpasswd file with usernames and hashed passwords.packages which will contain the packages.If you have a directory called data in your current path with the above
files and directories, you can run this package using the command:
docker run -d -v $PWD/data:/data -p 8080:8080 --name pypi devries/private_pypi:1.0
Passwords can be written to the htpasswd file using the htpasswd utility
which is a utility available from Apache. The htpasswd utility is installed
in the container, so you can run it with the command:
docker run --rm -ti -v $PWD:/data -w /data \
-u $(id -u):$(id -g) devries/private_pypi:1.0 \
htpasswd -cB htpasswd username
In the directions below replace "example" and "example.com" with your domain and the identifier you will use for you package index.
Add a repository to your poetry configuration using the command:
poetry config repositories.example https://pypi.example.com/
You can store your username and password for the repository using the command:
poetry config http-basic.example username password
You can now push a project to the private repository using the command:
poetry publish -r example
Add the following stanza to your pyproject.toml:
[[tool.poetry.source]]
name = "example"
url = "https://pypi.example.com/simple/"
secondary = true
Now when searching for packages, both the regular PyPI will be searched as well as the example PyPI.
Content type
Image
Digest
Size
92.3 MB
Last updated
about 6 years ago
docker pull devries/private_pypi:1.0