Actual DevPi Server for Store Your own Python Packages (+ mirror to PyPi)
364
This repository contains a Docker image for running a Devpi server, which is a Python package server and packaging/testing/release tool.
devpi-server and devpi-web.To run the container, use the following command:
docker run -d -p 3141:3141 --name devpi-server blackbotcommunity/devpi-server:latest
This will start the Devpi server and expose it on port 3141.
Now you can open in your browser: http://localhost:3141
DEVPI_ROOT_PASSWORD: The password for the root user (default: root).DEVPI_ROOT_USERS: Users that can create/update/delete indexes and users (default: root). Separate with commas.To persist the Devpi server data, you can mount a volume to /srv/devpi:
docker run -d -p 3141:3141 -v /path/to/data:/srv/devpi --name devpi-server blackbotcommunity/devpi-server:latest
The image uses a custom entrypoint script docker-entrypoint.sh which:
The Dockerfile is based on the official Python 3.9 slim image and installs necessary dependencies and the Devpi server.
FROM python:3.9-slim
RUN <<EOF
apt-get update
apt-get install -y build-essential
rm -rf /var/lib/apt/lists/*
EOF
RUN pip install devpi-server devpi-web
RUN mkdir -p /srv/devpi
WORKDIR /srv/devpi
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV DEVPI_ROOT_PASSWORD=root \
DEVPI_ROOT_USERS=root
EXPOSE 3141
CMD ["docker-entrypoint.sh", "devpi"]
The docker-entrypoint.sh script initializes and starts the Devpi server.
#!/bin/bash
set -e
function defaults {
export DEVPISERVER_SERVERDIR=/srv/devpi
echo "[INFO]: Setting default server directory to ${DEVPISERVER_SERVERDIR}"
}
function init_devpi {
echo "[RUN]: Initialise devpi-server at ${DEVPISERVER_SERVERDIR}"
devpi-init --root-passwd "${DEVPI_ROOT_PASSWORD}" --serverdir $DEVPISERVER_SERVERDIR --role master
touch $DEVPISERVER_SERVERDIR/DEVPI_SERVER_INITIALIZED
}
function start_devpi {
echo "[RUN]: Launching devpi-server"
devpi-server \
--host 0.0.0.0 \
--port 3141 \
--serverdir $DEVPISERVER_SERVERDIR \
--restrict-modify "${DEVPI_ROOT_USERS}"
}
defaults
if [ "$1" = 'devpi' ]; then
if [ ! -f $DEVPISERVER_SERVERDIR/DEVPI_SERVER_INITIALIZED ]; then
init_devpi
fi
start_devpi
fi
echo "[RUN]: Builtin command not provided [devpi]"
echo "[RUN]: $@"
exec "$@"
This project is licensed under the MIT License.
This is the first public project by the BlackBot team.
Content type
Image
Digest
sha256:8c1292e22…
Size
181.3 MB
Last updated
almost 2 years ago
docker pull blackbotcommunity/devpi-server