diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1707bc4..b07fa01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,16 @@ updates: interval: "weekly" assignees: - "gmazoyer" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "gmazoyer" + - package-ecosystem: "docker-compose" + directories: + - "/" + schedule: + interval: "weekly" + assignees: + - "gmazoyer" diff --git a/Dockerfile b/Dockerfile index 5a8e0e5..a2bbfdf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,19 +18,16 @@ RUN apk add --no-cache \ make \ musl-dev \ openldap-dev \ - py3-pip \ python3-dev \ - && python3 -m venv /opt/peering-manager/venv \ - && /opt/peering-manager/venv/bin/python3 -m pip install --upgrade \ - pip \ - setuptools \ - wheel + uv \ + && uv venv --seed --python python3 /opt/peering-manager/venv ARG PEERING_MANAGER_PATH COPY ${PEERING_MANAGER_PATH}/requirements.txt requirements-container.txt / +ENV UV_NO_CACHE=1 UV_PYTHON=/opt/peering-manager/venv/bin/python3 RUN \ sed -i -e 's/social-auth-core/social-auth-core\[all\]/g' /requirements.txt && \ - /opt/peering-manager/venv/bin/pip install -r /requirements.txt -r /requirements-container.txt + uv pip install -r /requirements.txt -r /requirements-container.txt FROM ${FROM} AS bgpq-builder diff --git a/README.md b/README.md index f123d05..3c6f327 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,48 @@ BASE_PATH=peering/ The container applies the value to the URLs, to the static files and to its health check. +## Upgrade PostgreSQL + +`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: + +```shell +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 _peeringmanager-postgres-data +git pull +docker compose up --detach --wait postgres +docker compose exec -T postgres psql -U peering_manager -d postgres