7 months ago
Using Nextjs and Sqlite. Next js needs the db to generate static pages at build time.
I've read the docs but anyone find a workaround to this?
Pinned Solution
7 months ago
If it's sqlite you are using cosider hosting libSQL as a separate service which would be always running. It's a sqlite fork compatible with most if not all ORMs.
The way I like to do this is have two separate endpoints, both private and public. Use the public endpoint just for build times so it can generate the static pages and private for runtime.
6 Replies
7 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
7 months ago
Which command is used to generate the static pages within your container during build time?
My first guess is that you could try moving the generation of static pages from the build step to the pre-deploy step.
roicort
Which command is used to generate the static pages within your container during build time?My first guess is that you could try moving the generation of static pages from the build step to the pre-deploy step.
7 months ago
Volumes are not mounted during pre-deploy either.
7 months ago
If it's sqlite you are using cosider hosting libSQL as a separate service which would be always running. It's a sqlite fork compatible with most if not all ORMs.
The way I like to do this is have two separate endpoints, both private and public. Use the public endpoint just for build times so it can generate the static pages and private for runtime.
smolpaw
If it's sqlite you are using cosider hosting libSQL as a separate service which would be always running. It's a sqlite fork compatible with most if not all ORMs.The way I like to do this is have two separate endpoints, both private and public. Use the public endpoint just for build times so it can generate the static pages and private for runtime.
7 months ago
Thank you. Yea, I resolved to use a separate Railway box.
Thought it'd be clean to have all services (next, websockets, db, etc) on one box with a Caddy reverse proxy...
brody
Volumes are not mounted during pre-deploy either.https://docs.railway.com/guides/pre-deploy-command
7 months ago
Thanks. Maximum reduction of Nextjs deploy friction may be $$$