Skip to content

Instantly share code, notes, and snippets.

@siriokun
Last active June 15, 2023 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siriokun/ec171a0875f58b185c7c16c74aa4175d to your computer and use it in GitHub Desktop.
Save siriokun/ec171a0875f58b185c7c16c74aa4175d to your computer and use it in GitHub Desktop.
fly.io for ghost
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = "sitename"
primary_region = "cdg"
[build]
image = "ghost:5.49-alpine"
[mounts]
source="data"
destination="/var/lib/ghost/content"
[http_service]
internal_port = 2368
force_https = true
auto_stop_machines = false
auto_start_machines = false
min_machines_running = 1
flyctl launch --name sitename --image=ghost:latest --region cdg --no-deploy
flyctl volumes create data --region cdg --size 1
## change fly.toml above
flyctl secrets set url=https://sitename.fly.dev
flyctl secrets set NODE_ENV=development
flyctl secrets set database__connection__filename=/var/lib/ghost/content/data/ghost-dev.db
flyctl deploy
@siriokun
Copy link
Author

siriokun commented May 23, 2023

Update Ghost

flyctl deploy -a yoursite --image=ghost:5.51.1-alpine

@siriokun
Copy link
Author

siriokun commented May 23, 2023

Migrate to Fly v2 (optional if prevously using v1)

flyctl migrate-to-v2
flyctl volumes destroy <vol_old>
fly machine clone --region arn <machine_id>

@siriokun
Copy link
Author

Persistent Storage

flyctl secrets set database__connection__filename=/var/lib/ghost/content/data/ghost-dev.db 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment