mosquito / pypi-server

Tornado based server like pypi.python.org. With caching from pypi.
MIT License
120 stars 38 forks source link

Use docker as it is supposed to be used for building from source #18

Closed adepretis closed 6 years ago

adepretis commented 6 years ago

The current Dockerfile uses precompiled local binaries which is not quite the way it should be. When building the docker image the application should be built from source. Thanks to @jgiannuzzi there was already a very clean and slim way to do this with a Python 2.7 Alpine image (see https://github.com/jgiannuzzi/docker-pypi-server/blob/master/Dockerfile).

Sure, one could use jgiannuzzi/pypi-server but I firmly believe that it would be better if the application author maintains a correct Docker setup. Therefore I am creating a PR using the application sources in the repository to build the image - @jgiannuzzi uses the release on PyPI.

@mosquito this also allows you to link the GitHub repo directly to Docker Hub and automatically build pypi-server images from master and release tags.

Furthermore it totally makes sense to use a slim base image based on Alpine instead of a bigger one like CentOS, etc. For this application to run Alpine is 100% sufficient and keeps the final image small.

For now I linked my fork to build automated images on https://hub.docker.com/r/25thfloor/mosquito-pypi-server/ - feel free to have look. Of course I'd prefer if @mosquito accepts the PR and I can delete this image afterwards and use the "official" one.