You probably want something like, I have not tested it. I don’t know what ENV variables ghost requires.
Most likely it was built on Nomad or even just older versions of flyctl. Now it’s fly machines, which is the gen v2 architecture.
The below shows my-ghost which would become https://my-ghost.fly.dev. Looks like env.url will need this path for Ghost.
[http_service] is just a shortcut for web apps, [[services]] are still a thing, but requires more fields, and can be used for port 80/443 apps, but below is the “shortcut” version.
I modified the ENV to better align with convention, it could be I did it wrong.
This also assumes you setup a volume, in the same region (lax) as your app. The volume should be called data given the source= statement in [mounts]
I would get this running first. But if you want to take this further, you can have 3 apps running at the smallest size on fly.io for free.
High availability would be to do this.
Get your environment working.
Setup LiteFS (link below) with Consul Lease
(optional) LiteFS Cloud which gives 5 minute snapshot backups to your ghost.db and allows you to restore, and autobacks up offsite location. Starts at $5 dollars a month with some capacity (10GB?), and grows at $0.50 a GB after.
Use “clone” feature to clone your machine in LAX (or whatever region you make your primary). This will make a new volume for the new machine as well.
Use “clone” feature to clone your machine into a NEW region, like EWR (New Jersey). This will make a new volumne in that new region for the new machine as well.
(optional) If you wait for VMs to spin down (see the Monitoring section in dashboard for them to be off). Make a request, see that the closest region that is healthy will spin up. If that time is too long, go ahead and set min_machines_running = 1 in fly.toml which will give you 1 minimum machine running at all times. A request can still start apps in other regions, but this gives you most requests a faster response. Depending on VM size, it can be covered (all three) in free tier, if you are using the lowest VM size. Not sure what Ghost will require.
This will give you a few things.
General Benefits
You have high availability within the same region, and DR across multiple regions.
The volumes have snapshot, but at a lower cadence, for DR.
You have machines in another region for lower latency to users.
The DB will replicate across all instances, keeping them in sync.
Only your primary LiteFS node can write, but the Consul Lease, and Fly proxy will ensure write requests (POST|PUT|DELETE|PATCH) go to the primary node automatically.
If you Setup LiteFS Cloud
You get point in time backups at 5 minute increments.
Almost instant rollback of DB and recovery
Easy ability to download the DB for local testing, or upload and replace DB
I applied your suggested config file. Then i got this:
> flyctl deploy
==> Verifying app config
Validating C:\Users\Johny\my-blog\fly.toml
Platform: machines
âś“ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'ghost:5.17.2' remotely...
image found: img_nr0lpjn5jqgv5q98
Watch your deployment at https://fly.io/apps/my-ghost/monitoring
Provisioning ips for my-ghost
Dedicated ipv6: 2a09:8280:1::f:7d4f
Shared ipv4: 66.241.124.194
Add a dedicated ipv4 with: fly ips allocate-v4
Creating 1GB volume 'data' for process group 'app'. Use 'fly vol extend' to increase its size
Error: input:4: createRelease We need your payment information to continue! Add a credit card or buy credit: https://fly.io/dashboard/john-weiss/billing
Is credit card required for the free site? Or is there no longer a free option?
I am not 100% sure what the issue is, I don’t work for fly. I believe if you look for other billing questions, you can find a billing email you can reach out too.
But that output does show and validate that the config is valid.
Good luck. I would recommend adding a card. You can see the billing upfront and how it’s billed.