Summary

This PR enables database detection and backup scheduling for Docker Compose deployments via GitHub App (using the dockercompose buildpack).

Problem

When deploying a Docker Compose file via GitHub App, database services are not detected and ServiceDatabase records are not created. This means automated backups are not available for databases in these deployments.

Deployment Method Model Creates ServiceDatabase Backups Available
Empty Docker Compose Service ✅ Yes ✅ Yes
GitHub App (dockercompose buildpack) Application ❌ No ❌ No
One-click Services (e.g., Supabase) Service ✅ Yes ✅ Yes

Solution

Added support for creating ServiceDatabase records when parsing Docker Compose files for Application models (GitHub App deployments).

Changes

Database Schema

  • Added application_id column to service_databases table
  • Made service_id nullable to support both relationship types

ServiceDatabase Model

  • Added application() relationship
  • Added helper methods: isApplicationDatabase(), isServiceDatabase(), getServer(), getParentResource()
  • Updated ownership queries to include Application-based databases

Application Model

  • Added serviceDatabases() relationship
  • Added hasServiceDatabases() and getBackupableDatabases() helper methods
  • Added cleanup of service databases on force delete

Docker Compose Parsing

  • Added coolify.service.subType=database label support for manual override
  • Added ServiceDatabase creation logic for Application model path
  • Creates records when databases (postgres, mysql, mariadb, mongodb, etc.) are detected

UI

  • Added “Backups” menu item for Docker Compose applications with detected databases
  • Created DatabaseBackups Livewire component for backup management
  • Supports multiple databases in a single compose file

Label Override

Users can manually specify that a service is a database by adding:

services:
my-custom-db:
image: my-company/custom-db
labels:
- coolify.service.subType=database

Testing

Added comprehensive test suite:

  • Database image detection tests
  • ServiceDatabase with Application relationship tests
  • Backup support availability tests
  • Ownership query tests

Screenshots/Demo

Will add demo video before merge

Checklist

  • Migration added for schema changes
  • Model relationships updated
  • Parsing logic updated
  • UI components created
  • Tests added
  • Documentation (label override) included

Fixes #7528

/claim #7528

Claim

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

Contributors

ER

Erdogan Kervanli

@erdogan98

100%

Sponsors

IL

Ilias Ism

@me

$100