I’ve followed all the steps in the docs. I simply cannot get this combination to work. I have an existing NextJS app (v13.3) that I want to deploy with an SQLite db.
My first attempt I ran fly launch
and it created the docker and toml files. It deployed fine and looking at the monitor tab, it started the NextJS server. But when I went to the url of the deployment, the website would not show. It would load and load until the browser just errored with a “not responding” screen.
I thought maybe it was because I needed to add secrets. So I added them with fly secret set
and added the NEXT_PUBLIC_
variables to my toml and dockerfile. Still didn’t work.
I created a volume for my SQLite db. In the docs it said to add something to my toml file, which I did
[mounts]
source = "primenv_db"
destination = "/mnt/primenv_db"
This did not work. I tried to run fly deploy
but I was met with errors that this configuration wasn’t working. Something about not being connected to my app or something (I can’t remember exactly). The error instructed me to remove these lines or use the “machines API”. I don’t know what this means. I looked around on the docs on how to connect my volume to my app but I cannot find it. From the docs it is also not clear to me what destination
means. Destination to what???
I tried to run fly deploy
again and now it was giving me errors about not being able to destroy the machine and something about a lease??? I don’t know what that means? It had my name and an expiration date that kept changing. I couldn’t find anything in the docs regarding this error.
Then I said F it, I’ll start over. I deleted everything and started again with fly launch
. It asked me if I wanted to use the existing toml file and I said yes. Then it did its thing and after it was done publishing the image it errored:
--> Pushing image done
image: registry.fly.io/primenv:deployment-01GXTCZNDHNQ82YX2TTCPEZZ0D
image size: 778 MB
Process groups have changed. This will:
* create 1 "app" machine
No machines in group 'app', launching one new machine
Oops, something went wrong! Could you try that again?
It’s also created two apps: primenv and something with a random name fly-builder-damp-voice-8827
. I can’t find what the second app is but this happens with every deploy.
Wasn’t expecting this to be so hard to deploy. I really want to try out Fly.io but this is discouraging.
So in short this is what I want to do:
- Deploy my NextJS app
- Setup an SQLite DB on a volume
- And I guess I need to connect this volume to my NextJS app somehow
I hope I can get this sorted with y’all.
Edit: Okay I deleted my apps and the dockerfile and the toml file and ran fly deploy
again. It deployed succesfully now but when I go to https://primenv.fly.dev nothing happens. The monitor tab says the server is running.