Skip to content

Remove custom upgrade hooks from the default Docker Compose flow #57

Description

@vitormattos

Context

The default docker-compose.yml currently mounts custom Nextcloud pre-upgrade and post-upgrade hooks.

A recent upgrade failed because one of the pre-upgrade hooks could not write to the backup directory:

/docker-entrypoint-hooks.d/pre-upgrade/01-check-disk-and-dump-db.sh: line 52: /backups/app_list.old: Permission denied

==> Failed at executing script "/docker-entrypoint-hooks.d/pre-upgrade/01-check-disk-and-dump-db.sh". Exit code: 1
app-1 exited with code 1 (restarting)

The problem is broader than this specific permission error: optional helper scripts should not be able to block the default Nextcloud upgrade path.

What should be changed

Remove the custom upgrade hooks from the default docker-compose.yml.

The default setup should no longer mount:

./app-hooks/pre-upgrade:/docker-entrypoint-hooks.d/pre-upgrade
./app-hooks/post-upgrade:/docker-entrypoint-hooks.d/post-upgrade

The scripts can remain in the repository.

Optional usage

This repository already documents docker-compose.override.yml as the mechanism for local Docker Compose customizations.

Update the existing documentation to show how the upgrade hooks can be enabled through that override.

For example:

services:
  app:
    volumes:
      - ./app-hooks/pre-upgrade:/docker-entrypoint-hooks.d/pre-upgrade
      - ./app-hooks/post-upgrade:/docker-entrypoint-hooks.d/post-upgrade
      - ./backups:/backups

Keep the documentation concise. It should only explain:

  • that the hooks are optional;
  • how to enable them using docker-compose.override.yml;
  • any required backup directory or permissions.

There is no need to create a new documentation section or duplicate the existing Docker Compose customization guidance.

Scope

This issue does not require:

  • redesigning the upgrade scripts;
  • fixing the current backup permission issue;
  • changing the logic inside the hooks;
  • adding new upgrade automation;
  • deciding whether these scripts should exist long-term.

The goal is only to remove them from the default critical path and keep them available as an optional customization.

Acceptance criteria

  • docker-compose.yml no longer mounts the custom pre-upgrade hooks
  • docker-compose.yml no longer mounts the custom post-upgrade hooks
  • the existing scripts remain available in the repository
  • the existing README documentation is updated with a concise example showing how to enable the hooks through docker-compose.override.yml
  • the documentation states that the hooks are optional
  • existing tests are updated if they assume the hooks are enabled by default
  • the default Docker Compose configuration remains valid

Good first issue

This should be a good starting point for contributors who want to become familiar with the Docker Compose structure used by this project.

The expected behavior is already defined and follows an existing repository convention: keep the default docker-compose.yml simple and use the Git-ignored docker-compose.override.yml for local customizations.

No redesign of the upgrade scripts is required.

If you have questions, feel free to ask in this issue.

⭐ If you find this project useful, consider starring the repository.

Expected result

The default installation follows the standard Nextcloud Docker upgrade flow without custom upgrade hooks.

Users who want the additional upgrade checks can enable them through their local docker-compose.override.yml.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions