Improve Tinybird login experience

- This helps clean up the TB setup since we no longer need to install the CLI tools locally
- The service dependency chaining is a bit annoying here but it should all work
- We have to change some of the mounts around because of how TB works
  and where it expects tokens to be
This commit is contained in:
James Loh
2025-06-25 16:06:11 +10:00
parent 57c084aac0
commit 29e86facec
4 changed files with 58 additions and 7 deletions

View File

@@ -116,21 +116,39 @@ services:
# Suporting Services
tinybird-login:
build:
context: ./tinybird
dockerfile: Dockerfile
working_dir: /home/tinybird
command: /usr/local/bin/tinybird-login
volumes:
- tinybird_home:/home/tinybird
- tinybird_files:/data/tinybird
profiles: [analytics]
networks:
- ghost_network
tty: true
restart: no
tinybird-sync:
# Do not alter this without updating the Ghost container as well
image: ghost:${GHOST_VERSION:-5-alpine}
command: >
sh -c "
if [ -d /var/lib/ghost/current/core/server/data/tinybird ]; then
rm -rf /shared/tinybird/*;
cp -rf /var/lib/ghost/current/core/server/data/tinybird/* /shared/tinybird/;
rm -rf /data/tinybird/*;
cp -rf /var/lib/ghost/current/core/server/data/tinybird/* /data/tinybird/;
echo 'Tinybird files synced into shared volume.';
else
echo 'Tinybird source directory not found.';
fi
"
volumes:
- tinybird_files:/shared/tinybird
- tinybird_files:/data/tinybird
depends_on:
tinybird-login:
condition: service_completed_successfully
networks:
- ghost_network
profiles: [analytics]
@@ -140,14 +158,14 @@ services:
build:
context: ./tinybird
dockerfile: Dockerfile
working_dir: /home/tinybird
working_dir: /data/tinybird
command: >
sh -c "
tb --cloud deploy
tb-wrapper --cloud deploy
"
volumes:
- .tinyb:/home/tinybird/.tinyb
- tinybird_files:/home/tinybird
- tinybird_home:/home/tinybird
- tinybird_files:/data/tinybird
depends_on:
tinybird-sync:
condition: service_completed_successfully
@@ -172,6 +190,7 @@ volumes:
caddy_data:
caddy_config:
tinybird_files:
tinybird_home:
networks:
ghost_network: