Make Ghost Docker Compose stack ephemeral #93
+1,147
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the Ghost Docker Compose stack configuration ephemeral by deploying it via Ignition at boot time, while keeping secrets and persistent data on block storage.
Architecture
compose.yml/etc/ghost-compose/.env.config/etc/ghost-compose/.env.secrets/var/mnt/storage/ghost-compose/caddy/*/etc/ghost-compose/caddy/mysql-init/*/etc/ghost-compose/mysql-init/Key Changes
compose.yml.tftpl,env.config.tftpl, Caddyfile, and snippets underopentofu/modules/vultr/instance/userdata/ghost-compose/ghost.buto deploy config files to/etc/ghost-compose/ghost-compose.serviceWorkingDirectory to/etc/ghost-composeghost_domain,ghost_admin_domain,admin_ip,mail_smtp_userto instance moduleTF_VAR_admin_ipfor Caddy ACL configurationSecurity
.env.configwith non-sensitive values.env.secretson block storage with 0600 permissions{$HEALTH_CHECK_TOKEN}environment variable instead of hardcoded valueMigration
Before deploying, follow the migration runbook at
docs/runbooks/env-secrets-migration.mdto:.env.secretson block storage with the required secretsNote: This will recreate the instance (Ignition config is immutable).
Test Plan
.env.secretscreated on block storage before deployment/etc/ghost-compose/filesLinear Issues
Closes GHO-46, GHO-47, GHO-48, GHO-49, GHO-50, GHO-51, GHO-52, GHO-53, GHO-54