This repository contains the components needed to build Peering Manager as a Docker container. It provides everything that is needed to run the whole application stack.
This project relies only on Docker and docker-compose. Make sure to use a decent version of each tool and everything will work as expected.
To check the version installed on your system run docker --version and
docker compose --version.
Official Docker images of Peering Manager are available on Docker Hub
To build your own images you'll need the following binary: bash, curl,
git and jq (in addition to Docker and standard UNIX utils).
./build.sh can be used to rebuild Docker images. See ./build.sh --help for
more information. build-latest.sh will automatically retrieve the last
available version of Peering Manager and build its image.
To run the Peering Manager application stack with Docker Compose, copy the
docker-compose.override.yml.example file into docker-compose.override.yml
and override definitions from this file.
Peering Manager 1.11 and later run housekeeping and PeeringDB synchronisation
from the rqworker service. Manage the schedule of each task from
Admin > Scheduled Tasks in the web interface.
The housekeeping and peeringdb-sync services stay in docker-compose.yml
for users who prefer an external scheduler. They do not start by default.
First disable the matching tasks in Admin > Scheduled Tasks, then start
them:
docker compose --profile external-scheduler up --detachDo not run a task twice. Two runs of the same task waste resources, and a PeeringDB synchronisation can take about 90 minutes.
Set BASE_PATH in env/peering-manager.env to serve Peering Manager from a
directory, for example https://example.com/peering/:
BASE_PATH=peering/The container applies the value to the URLs, to the static files and to its health check.
docker-compose.yml tracks a recent PostgreSQL release, so a git pull can
move the database to a new major version. A server refuses a data directory
that another major version wrote, so every major bump needs a dump and a
restore.
Take the dump before you pull, while the old server still runs:
docker compose exec -T postgres pg_dumpall -U peering_manager >dump.sql
docker compose down
docker volume ls # find the name of the postgres volume
docker volume rm <project>_peeringmanager-postgres-data
git pull
docker compose up --detach --wait postgres
docker compose exec -T postgres psql -U peering_manager -d postgres <dump.sql
docker compose up --detachCompose puts the name of your project in front of the volume, hence the
docker volume ls step.
The restore reports two errors, one for the role and one for the database that already exist. Ignore them, because the new container creates both before the restore runs.
To stay on your current major version, pin the image in your
docker-compose.override.yml. For example, to keep PostgreSQL 17:
services:
postgres:
image: docker.io/postgres:17-alpineOne extra step applies when you come from PostgreSQL 17 or older. Version 18
keeps its data in a directory named after the major version, so
docker-compose.yml mounts the volume on /var/lib/postgresql instead of
/var/lib/postgresql/data. Copy that change if you declare the postgres
service yourself.
This work is based on the great netbox-docker project and uses the same license.