I just tried to follow the Next.js tutorial for an existing next.js project on my local computer.
It failed at detecting the Next.js app but detected NodeJS app. It asked for the app name, the region to deploy, and if I want PG and Redis. After that it failed with the following error: Error: open Dockerfile: no such file or directory
Am I doing something wrong? I don’t have Docker in that directory.
Thank you for the quick response.
I have the following fly version:
flyctl v0.1.23 darwin/arm64 Commit: 4aa1bbf64fc3d6696450dec51ccd0bfd5782454c-dirty BuildDate: 2023-05-30T15:29:05Z
After fly launch I get the following:
...
installing: pnpm add -D @flydotio/dockerfile
Packages: +35
+++++++++++++++++++++++++++++++++++
Progress: resolved 415, reused 396, downloaded 11, added 15, done
devDependencies:
+ @flydotio/dockerfile 0.2.11
Done in 2.8s
Error: open Dockerfile: no such file or directory
Edit: The above presumes that you have a fly.toml file. If you don’t, run fly apps list to see if your app is there. If so, you can destroy it using fly destroy -y followed by the app name, then run fly launch again.
Quick question: why does the fly launch not recognize the next.js app and falls back to nodejs?
Finally, is fly launch just a helper? That is, once I am more familiar with the Fly platform, can I just create my fly.toml and Dockerfile’s by hand and not worry about automated scripts?
I’ll give quick answers, but feel free to ask follow up questions if you want more depth.
Node has too many frameworks. And options. For example, you are using pnpm. Supporting each combination is unworkable. So, I’m starting over. I built a base that supports all node apps, and then adding specific tailoring based on feature detection. That way pnpm support is implemented exactly once and works with all frameworks.
Indeed. If you want to chase all the way down the rabbit hole, you will end up with a REST interface. There also are more granular CLI commands that will do specific tasks, like create an application, clone a machine, set a secret, or create a volume. The fly.toml file itself is only needed by the helpers, and Dockerfiles are but one way to create an OCI image.