{"id":17002853,"url":"https://github.com/minchinweb/docker-pypi","last_synced_at":"2025-04-05T19:16:21.990Z","repository":{"id":40467605,"uuid":"182802534","full_name":"MinchinWeb/docker-pypi","owner":"MinchinWeb","description":"CloudPyPI packaged for Docker","archived":false,"fork":false,"pushed_at":"2023-09-25T12:42:15.000Z","size":41,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-11T16:36:47.471Z","etag":null,"topics":["docker-image","pypi-server","pypicloud"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MinchinWeb.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-22T14:17:02.000Z","updated_at":"2022-01-30T17:58:14.000Z","dependencies_parsed_at":"2025-02-11T16:44:46.726Z","dependency_job_id":null,"html_url":"https://github.com/MinchinWeb/docker-pypi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fdocker-pypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fdocker-pypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fdocker-pypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fdocker-pypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinchinWeb","download_url":"https://codeload.github.com/MinchinWeb/docker-pypi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386267,"owners_count":20930619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","pypi-server","pypicloud"],"created_at":"2024-10-14T04:29:13.341Z","updated_at":"2025-04-05T19:16:21.961Z","avatar_url":"https://github.com/MinchinWeb.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyPI Server\r\n\r\n*[PyPI](https://pypi.org/)* (aka the *Python Package Index*) is the public\r\nservice that provides access to packaged Python code. This Docker image\r\nprovides a locally install implementation. It has two obvious use-cases: 1) to\r\nact as a local (and thus faster) mirror of the official PyPI (with the option\r\nto cache requested packages on the fly), and 2) to provide a private location\r\nto publish Python packages (e.g. for internal projects).\r\n\r\nUnder the hood, this is using\r\n[PyPICloud](https://pypicloud.readthedocs.io/en/latest/).\r\n\r\n[![GitHub issues](https://img.shields.io/github/issues-raw/minchinweb/docker-pypi.svg?style=popout)](https://github.com/MinchinWeb/docker-pypi/issues)\r\n\u003c!--\r\n[![Docker Pulls](https://img.shields.io/docker/pulls/minchinweb/pypi.svg?style=popout)](https://hub.docker.com/r/minchinweb/pypi)\r\n![MicroBadger Layers](https://img.shields.io/microbadger/layers/layers/minchinweb/pypi.svg?style=plastic)\r\n![MicroBadger Size](https://img.shields.io/microbadger/image-size/image-size/minchinweb/pypi.svg?style=plastic)\r\n--\u003e\r\n\r\n## How to Use This\r\n\r\n### Docker Setup\r\n\r\nThe container is designed to be used directly. Here is a portion of my personal\r\n'docker-compose.yaml' file:\r\n\r\n    services:\r\n      # many others...\r\n\r\n      pypi:\r\n        image: ghcr.io/minchinweb/pypi:1\r\n        restart: unless-stopped\r\n        environment:\r\n          - PUID=${PUID}\r\n          - PGID=${PGID}\r\n        ports:\r\n          - 6543:8080\r\n        volumes:\r\n          - ${DOCKER_USERDIR}/volumes/pypi/:/config\r\n\r\n\r\n`PUID`, `GUID`, and `DOCKER_USERDIR` are environmental variables used by\r\nservice services in my local stack, and are provided by a `.env` file located\r\nin the same directory as my `docker-compose.yaml` file. That said, none of\r\nthese are absolutely required, as (hopefully) useful defaults have been\r\nprovided.\r\n\r\n### PyPICloud Configuration\r\n\r\nIf you map `/config` (which is probably what you want), you'll need to provide\r\na `config.ini` file in that directory. The [default\r\nconfiguration](https://github.com/MinchinWeb/docker-pypi/blob/master/root/config/config.ini)\r\ncan be used as is (although you have to copy it in place). Note that some defaults have been changed from the upstream defaults. The [PyPICloud\r\ndocumentation](https://pypicloud.readthedocs.io/en/latest/topics/configuration.html)\r\nwill be useful if you want to customize it. In particular, it has options to\r\nuse cloud storage for Python packages you are hosting or to use a \"full\"\r\ndatabase (rather than the default of SQLite) for caching your list of available\r\npackages.\r\n\r\nPersonally, the biggest option I changed from the upstream default was to add\r\n`pypi.fallback = cache`, which will cause packages to be downloaded from the\r\nmain PyPI and then cached the first time they are requested.\r\n\r\n### Local Web Configuration\r\n\r\nUnder the provided configuration, you need to log in to actually download any\r\npackages. Go to the web address, and the first time you do, it will ask you to\r\ncreate an admin user. Log in with this admin user to create other users and\r\nmanually download other packages.\r\n\r\nThe web address (once logged in) will show you the `pip` command to use to\r\ndownload packages from here.\r\n\r\n### Local (per machine) Pip Configuration\r\n\r\nPip can be configured with an extra URL to search for packages. By setting this\r\nup, `pip` will automatically make use for your private PyPI server. First\r\ndetermine where your [`pip.conf` file is on\r\ndisk](https://pip.pypa.io/en/stable/user_guide/#configuration). To use your\r\nlocal server alone, add the following to your `pip.conf`:\r\n\r\n    [global]\r\n    trusted-host = http://localhost\r\n    index-url = http://localhost:6543/simple/\r\n\r\n**Note**: on Windows, this files is actually called `pip.ini`.\r\n\r\n**Note 2**: Adjust the URL to match the hostname of the machine you're running\r\nDocker on, and the port to match what you set in the `docker-compose.yaml`\r\nabove.\r\n\r\n**Note 3**: Using `index-url` (as above, in your `pip.conf`) is going to make\r\nyour server the only place `pip` will look for packages, and thus if you're\r\nserver is down, `pip` won't work. *pypicloud* is set to either (by default)\r\nforward to or (with the `pypi.fallback = cache` in `/config/config.ini`) cache\r\nfrom the Global PyPI, so you'll still have access to all packages. If you are\r\njust hosting private packages, you may want to use the `extra-index-url`\r\nsetting in your `pip.conf` instead.\r\n\r\nTo upload, you will need to update your `.pypirc` file (typically at\r\n`$HOME/.pypirc`)\r\n\r\n    [pypicloud]\r\n    repository: http://localhost:6543/simple/\r\n    username: [username]\r\n    password: [password]\r\n\r\nAgain, the URL will likely need to be adjusted. Usernames and passwords can be\r\nset on the Web UI.\r\n\r\n## Why I Created This\r\n\r\nor, *What Problems is This Trying to Solve?*\r\n\r\nBecause I could? (I always think that's a valid reason!)\r\n\r\nFor me, I like the idea of having a local backup copy of certain Python\r\npackages.\r\n\r\nAlso, it provided a real-world use of my [Python base\r\nimage](https://github.com/MinchinWeb/docker-python).\r\n\r\n\r\n## Prior Art\r\n\r\nThis wouldn't work with the\r\n[PyPICloud](https://pypicloud.readthedocs.io/en/latest/) project. It is also\r\nbuilt on my [Python base image](https://github.com/MinchinWeb/docker-python).\r\n\r\nSteven Arcangeli's [docker-ized version of\r\nPyPICloud](https://github.com/stevearc/pypicloud-docker) were used as an\r\ninspiration and a model for creating this image. (Steven is also the creator of\r\nPyPICloud.)\r\n\r\nThe `/sbin/setuser` script is cribbed from [Phusion's base\r\nimage](http://phusion.github.io/baseimage-docker/).\r\n\r\n\r\n## Known Issues\r\n\r\n- you'll need to log in via the WebUI once the image is first up to create a\r\n  user\r\n- by default, you need to have a user account (and then provider the username\r\n  and password when you run `pip`); if you want, you can adjust the settings to\r\n  allow anonymous downloads.\r\n- the favicon will return a 404 error\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminchinweb%2Fdocker-pypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminchinweb%2Fdocker-pypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminchinweb%2Fdocker-pypi/lists"}