Summary

  • Fixes Docker Compose deployments via GitHub App (dockercompose buildpack) not detecting database services and not creating ServiceDatabase records, which prevented automated backups
  • Adds nullable application_id FK to service_databases table so a ServiceDatabase can belong to either a Service (existing behavior) or a docker-compose Application
  • Creates ServiceDatabase records during Application model parsing in parseDockerComposeFile() when database images are detected via isDatabaseImage()
  • Adds a Backups tab to the Application configuration page for dockercompose build pack applications
  • Updates all code paths (backup execution, download, proxy start/stop, container status checking, file storage operations) to resolve server/network through either Service or Application ownership

Issue

Resolves https://github.com/coollabsio/coolify/issues/7528

/claim #7528

Category

  • Bug fix
  • New Feature

Technical Details

Database Changes

  • Migration: Adds nullable application_id (FK to applications) to service_databases table, makes service_id nullable
  • Cascade delete ensures Application-owned ServiceDatabase records are cleaned up when the Application is deleted

Model Changes

  • ServiceDatabase: Added application() relationship, getOwner(), getOwnerUuid(), getServer(), getNetwork() helper methods. Updated team(), workdir(), restart(), getServiceDatabaseUrl(), ownedByCurrentTeam(), ownedByCurrentTeamAPI() to handle both ownership types
  • Application: Added composeDatabases() relationship. Cleanup of compose databases when switching away from dockercompose build pack

Parser Changes (shared.php)

  • In the Application model path of parseDockerComposeFile(), after isDatabaseImage() detection, creates/updates ServiceDatabase records with application_id (skips preview deployments)
  • Cleans up stale ServiceDatabase records when services are removed from the compose file

Updated Code Paths

  • DatabaseBackupJob: Server resolution, container naming, network for S3 upload
  • StartDatabaseProxy / StopDatabaseProxy: Network, server, container name resolution
  • GetContainersStatus: Owner UUID resolution for TCP proxy detection
  • ScheduledDatabaseBackup: Server resolution
  • BackupExecutions, BackupEdit, Import: Server resolution, redirect handling
  • LocalFileVolume: Server resolution for file storage operations
  • databases.php helper: Server resolution for backup cleanup
  • web.php download route: Server resolution for backup downloads
  • getResourceByUuid: Team ownership check for Application-owned ServiceDatabases

UI Changes

  • Added “Backups” tab to Application configuration sidebar (only for dockercompose build pack)
  • Created ComposeBackups Livewire component with database selector and backup management

Steps to Test

  1. Create a new Application using the dockercompose buildpack via the GitHub App flow
  2. Use a repo with a docker-compose.yml containing a database service (e.g., postgres:16-alpine) and at least one non-database service
  3. Deploy the Application
  4. Navigate to Project > Environment > Application > Configuration > Backups
  5. Verify the database service is listed and you can create a scheduled backup
  6. Run a backup and confirm a new execution entry is created

AI Usage

  • AI is used in the process of creating this PR

Contributor Agreement

[!IMPORTANT]

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have tested the changes thoroughly and am confident that they will work as expected without issues when the maintainer tests them

Claim

Total prize pool $100
Total paid $0
Status Pending
Submitted February 09, 2026
Last updated February 09, 2026

Contributors

BU

buildingvibes

@buildingvibes

100%

Sponsors

IL

Ilias Ism

@me

$100