Any way to access a volume during build?
59023g
PROOP

4 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?

Solved$10 Bounty

6 Replies

Railway
BOT

4 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!


roicort
HOBBY

4 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.

brody
EMPLOYEE

4 months ago

Volumes are not mounted during pre-deploy either.

https://docs.railway.com/guides/pre-deploy-command


smolpaw
HOBBY

4 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.

59023g
PROOP

4 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

59023g
PROOP

4 months ago

Thanks. Maximum reduction of Nextjs deploy friction may be $$$


Loading...