Skip to content

Deploy a private PyPI server on Dokku

License

Notifications You must be signed in to change notification settings

Bixoto/dokku-pypiserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

dokku-pypiserver

This repository contains a ready-to-use Dockerfile to deploy a PyPI server on Dokku.

Note: it is configured with no authentication, so it should never be exposed on the outside.

Setup

On your Dokku server:

APP_NAME=pypiserver # change if needed
dokku apps:create $APP_NAME

# Create storage directories
sudo mkdir /var/lib/dokku/data/storage/pypiserver-data-packages
sudo chown 32767:32767 /var/lib/dokku/data/storage/pypiserver-data-packages
dokku storage:mount $APP_NAME /var/lib/dokku/data/storage/pypiserver-data-packages:/data/packages

dokku ports:set pypiserver http:80:8080

Then clone this repository, and push to your Dokku remote to deploy it.

Upgrade

To upgrade, bump the version in the Dockerfile and push.

Cookbook

In the example snippets below we assume you set the dokku app domain to pypi.example.com. Replace this with your own domain. To configure the app to be accessible in your VPN only and have HTTPS, see the tutorial on our blog. foo is a placeholder; replace it with the alias you want.

Publish a package

# Config
poetry config repositories.foo https://pypi.example.com/

# Publish
poetry build
poetry publish -r foo

Install a package

poetry source add --default foo https://pypi.example.com/simple/
poetry add your_package