8 months ago
I am building an app in con junction with Claude. Claude has written all the servers I have deployed with you, including stranded-astronanaut-server. I am a newbie. The server apparently malfunctioned yesterday after an update and eliminated all the media. The Server was repeatedly modified to integrate with MondoDB explicitly to persistently store the image data. Now Claude says that its previous efforts were ineffectual and that nothing other than the urls were being Stored in MongoDB. The last time this happened (6 weeks ago), it claimed it was moving everything into "containers". Now Claude says this didn't happen. When I told it I was going to contact you it proposed the following questions:
Key questions to ask Railway:
How does container state persistence work across deployments?
Why would memory-stored data survive some deployments but not others?
What triggers a full container rebuild vs a cached deployment?
Is there any filesystem persistence outside of defined volumes?
Thanks for the help.
1 Replies
8 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open itsrems • 9 months ago
8 months ago
For the first.
By default, containers are ephemeral. Any files written to the container's filesystem during runtime are lost on redeployments unless you
explicitly attach a Volume.
Volumes are separate storage spaces mounted to your service at runtime (e.g., / app/data), and persist files across container restarts and
deployments
Any data written outside a mounted volume vanishes when a new container is deployed or rebuilt.
For the second.
In-memory data (like objects in RAM or temporary caches) is tied to the running container process. If a deployment restarts the service (same container, hot reload), that memory can persist during that session. Key word can, sometimes it does sometimes it doesnt lol.
For the third.
Cached deployment happen when Railway detects no change in your build setup.
Full rebuilds are triggered by modifications to build context. Things like a package.json, Dockerfile, or some dep. And explicit rebuild commands/actions.
For the fourth.
Short answer no. Volumes only by design. Answered in the first.
Let me know if this was helpful!