#Storage Volume Help

21 messages · Page 1 of 1 (latest)

hidden arrowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

azure heathBOT
#

Project ID: 28af0e25-6b53-46d0-80d5-b5dc38b521a0

dapper elk
#

The volume environment variables are injected to your service by default.

More docs on Volumes here https://docs.railway.app/reference/volumes

Also, I found I found with some projects that if I don’t mount a volume to /app/<mount_point> I can’t write to them. Maybe it’s just me and the languages I use

Railway Docs

Documentation for Railway

tulip vessel
#

I'm happy to report theres no issues with the mount point with go apps

dapper elk
#

Oh cool. Good to know

tulip vessel
#

if you mount to /data you must write to /data the starting forward slash is very important

#

you don't want to use relative paths

#

/data/text.txt

#

vin help

dapper elk
#

It’s an absolute path. It states from the root go into data

tulip vessel
#

that's the word I was looking for

dapper elk
#

A relative path is what you have where it will look for the data folder next to your binary

#

And your binary lives in /app/

#

Use the same path in the read as well

#

But yes, that should read and write

tulip vessel
#

I can confirm that's how it works

#

oh yeah

#

one sec

#

i thought for a sec that writefile doesnt create the file if it doesnt exist

#

but the volume didnt exist lol

dapper elk
#

🎉