Compare commits

5 Commits

Author SHA1 Message Date
Nick Stokoe
f35dd620aa UPGRADING-NC.md - draft version 2025-05-26 13:09:28 +01:00
Nick Stokoe
66b472dab2 templates/docker-compose/docker-compose.yml - drop "version" attribute
Docker compose doesn't seem to like it and complains now.
2025-05-26 13:09:28 +01:00
Nick Stokoe
7061ef37f8 templates/docker-compose/docker-compose.yml - bump nextcloud to v31
Actual upgrade done one major version at a time.
2025-05-26 13:09:28 +01:00
Nick Stokoe
5c12a6f053 templates/docker-compose/postgres/Dockerfile.j2 - bump to v17 2025-05-26 13:09:28 +01:00
Nick Stokoe
7c4f1091b4 * - use "docker compose" not "docker-compose"
Latter is obsolete now
2025-05-26 13:09:19 +01:00
8 changed files with 35 additions and 17 deletions

19
UPGRADING-NC.md Normal file
View File

@@ -0,0 +1,19 @@
DRAFT!
upgrade one major version at a time
check that the version of postgresql is adequate for the target version before upgrading
if it isn't, upgrade it:
dump the data
move the volume aside
recreate the volume
upgrade
start
re-import
delete the old volume
copy over the pg_hba.conf, otherwise the auth credentials won't be used correctly (need:
host all all all md5)

View File

@@ -12,7 +12,7 @@
navidrome_hostname: nd.noodlefactory.co.uk
letsencrypt_email: webmaster@noodlefactory.co.uk
docker_compose_base_dir: /opt/docker-compose
docker_compose_cmd: docker-compose
docker_compose_cmd: docker compose
borg_passphrase: "{{lookup('passwordstore', 'servers/snackpot/borg.passphrase')}}"
smtp_password: "{{lookup('passwordstore', 'servers/snackpot/smtp.password')}}"
borg_ssh_key: "{{lookup('passwordstore', 'servers/snackpot/borg.id_rsa')}}"

View File

@@ -8,22 +8,22 @@ set -o errexit
cd "/opt/docker-compose"
set -vx
docker-compose exec -T -u www-data nextcloud ./occ maintenance:mode --on ||
docker compose exec -T -u www-data nextcloud ./occ maintenance:mode --on ||
echo "WARNING: Couldn't stop nextcloud container, proceeding anyway"
docker-compose down --remove-orphans || {
echo "ERROR: Couldn't stop docker-compose, restarting and aborting"
docker compose down --remove-orphans || {
echo "ERROR: Couldn't stop docker compose, restarting and aborting"
docker network prune --force
docker-compose up -d
docker compose up -d
exit
}
docker network prune --force # remove dangling networks
docker-compose run --name borgmatic -T --rm borgmatic /backup.sh run ||
docker compose run --name borgmatic -T --rm borgmatic /backup.sh run ||
echo "ERROR: Couldn't run borgmatic"
docker-compose up -d main-services || {
echo "ERROR: couldn't restart docker-compose services, aborting with no services!"
docker compose up -d main-services || {
echo "ERROR: couldn't restart docker compose services, aborting with no services!"
exit 1
}
docker-compose exec -T -u www-data nextcloud ./occ maintenance:mode --off ||
docker compose exec -T -u www-data nextcloud ./occ maintenance:mode --off ||
echo "Couldn't turn off nextcloud's maintainance mode"
docker-compose run --name borgmatic -T --rm borgmatic /backup.sh check ||
docker compose run --name borgmatic -T --rm borgmatic /backup.sh check ||
echo "Couldn't run the bormatic backup check"

View File

@@ -1,2 +1,2 @@
#!/bin/sh
exec docker-compose run -- borgmatic borg "$@"
exec docker compose run -- borgmatic borg "$@"

View File

@@ -1,2 +1,2 @@
#!/bin/sh
exec docker-compose run -- borgmatic borgmatic "$@"
exec docker compose run -- borgmatic borgmatic "$@"

View File

@@ -8,7 +8,7 @@ nextcloud_db_user={{ nextcloud_db_user }}
nextcloud_db={{ nextcloud_db }}
DOCKER_EXE() {
( cd $dc_dir; docker-compose exec "$@" )
( cd $dc_dir; docker compose exec "$@" )
}
ON_POSTGRES() {

View File

@@ -2,7 +2,6 @@
# Adapted from:
# https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml
version: '3'
volumes:
postgres:
@@ -56,7 +55,7 @@ services:
- redis:/data
nextcloud:
image: nextcloud:28-fpm-alpine
image: nextcloud:31-fpm-alpine
restart: always
volumes:
- nextcloud_src:/var/www/html
@@ -76,7 +75,7 @@ services:
# test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
nextcloud_cron:
image: nextcloud:28-fpm-alpine
image: nextcloud:31-fpm-alpine
restart: always
volumes:
- nextcloud_src:/var/www/html

View File

@@ -1,2 +1,2 @@
FROM postgres:11.9-alpine
FROM postgres:17-alpine
COPY --chown={{ postgres_db_user }}:{{ postgres_db_user }} init.sql /docker-entrypoint-initdb.d/