From 6587c59375105c3af3a6a1cb99517806320c121b Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 2 Aug 2026 20:22:57 +0800 Subject: [PATCH] feat: add volume mounts to persist Tinybird data (#2525) * feat: add volume mounts to persist Tinybird data Added volume mounts for Tinybird Local to persist data across container restarts and recreations: - ./data/tinybird/clickhouse:/var/lib/clickhouse (ClickHouse database) - ./data/tinybird/redis:/redis-data (Redis metadata) Without these volumes, all Tinybird data (datasources, pipes, materialized views, and ingested data) is lost when the container is removed or updated. This change is essential for production self-hosted deployments where Tinybird data needs to survive container lifecycle events. Implemented in both docker-compose.yaml and docker-compose.github-packages.yaml. * fix: add data/ to .gitignore to prevent committing Tinybird volumes The Tinybird volume bind mounts create ./data/tinybird/ directories containing ClickHouse database and Redis metadata. Without a .gitignore entry, these show up as untracked files in git status and could be accidentally committed with 'git add .', potentially adding large or sensitive database files to the repository. This fix adds data/ to .gitignore to prevent this issue. * refactor: switch Tinybird to named volumes for consistency Changed from bind mounts (./data/tinybird/*) to Docker named volumes (tinybird-clickhouse-data, tinybird-redis-data) to match the pattern used by libsql-data and workflows-data. Benefits: - Consistent with existing volume management in the compose files - No .gitignore changes needed (Docker manages volume storage) - More portable across different host systems - Can use standard docker volume commands for management Reverted the previous .gitignore change since it's no longer needed. --- docker-compose.github-packages.yaml | 7 +++++++ docker-compose.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/docker-compose.github-packages.yaml b/docker-compose.github-packages.yaml index bed7e8cc..087bee87 100644 --- a/docker-compose.github-packages.yaml +++ b/docker-compose.github-packages.yaml @@ -8,6 +8,10 @@ volumes: name: openstatus-libsql-data workflows-data: name: openstatus-workflows-data + tinybird-clickhouse-data: + name: openstatus-tinybird-clickhouse-data + tinybird-redis-data: + name: openstatus-tinybird-redis-data services: # External services @@ -45,6 +49,9 @@ services: - "7181:7181" environment: - COMPATIBILITY_MODE=1 + volumes: + - tinybird-clickhouse-data:/var/lib/clickhouse + - tinybird-redis-data:/redis-data healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7181/"] interval: 15s diff --git a/docker-compose.yaml b/docker-compose.yaml index 1a03b12c..2d0079ea 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,6 +8,10 @@ volumes: name: openstatus-libsql-data workflows-data: name: openstatus-workflows-data + tinybird-clickhouse-data: + name: openstatus-tinybird-clickhouse-data + tinybird-redis-data: + name: openstatus-tinybird-redis-data services: # External services @@ -45,6 +49,9 @@ services: - "7181:7181" environment: - COMPATIBILITY_MODE=1 + volumes: + - tinybird-clickhouse-data:/var/lib/clickhouse + - tinybird-redis-data:/redis-data healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7181/"] interval: 15s -- 2.51.2