5 days ago
I'm using claude code to push through git to railway and created a blog page on my site. when i push new versions, the blogs get wiped. claude says to do this but the exact paths to do this don't seem to be in my railway dashboard.
The problem is clear. When DATA_DIR isn't set as a Railway environment variable, posts write to the container's project directory — which gets wiped every time a new deploy runs. Events aren't affected because the scraper rebuilds them automatically, but blog posts have no way to come back.
The posts are gone unfortunately — Railway doesn't keep runtime files from the old container. Here's the fix:
In your Railway dashboard:
Go to your service → Volumes tab → Add Volume
Mount path: /data
Then go to Variables tab → add: DATA_DIR = /data
That gives you a persistent disk that survives every future redeploy. Blog posts, uploaded photos, and events cache will all live there safely.
Pinned Solution
5 days ago
Right click your service and click Attach volume, set it to /data.
Then go to the variables tab, and add a DATA_DIR=/data env var.
Attachments
2 Replies
Status changed to Awaiting Railway Response Railway • 5 days ago
5 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 5 days ago
5 days ago
Right click your service and click Attach volume, set it to /data.
Then go to the variables tab, and add a DATA_DIR=/data env var.
Attachments
4 days ago
thank you.
Status changed to Solved brody • 4 days ago