a month ago
I'm new to Railway. Have been poking around this week but have 2 scenarios I'm looking for guidance on.
- Using Ollama to host a small embeddings model. Normally I would just SSH into my server and run something like
ollama pull nomic-embed-textfrom the command line. Since I can't do that with Railway what's the best practice for similar services? (I ended up turning on a public URL, using Ollama's CURL endpoit, running a command, then turning off the public URL. That worked in this case, but not every CLI tool has a CURL endpoint.) - Run WordPress with a custom theme? Assume it is something like mount a volume at
/wp-content/themes/and hook that to GitHub somehow. But it looks like all the WordPress template at /deploy are mounted to/var/www/htmlalready.
Pinned Solution
a month ago
Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup
for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent
5 Replies
a month ago
You can SSH into your service using Railway. You just right-click on your service and select copy ssh command (you need to have railway cli installed).
a month ago
Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup
for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent
Status changed to Solved chandrika • about 1 month ago
ilyass012
Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent
a month ago
Thanks, this is the best and most helpful reply.
Status changed to Awaiting Railway Response Railway • 30 days ago
Status changed to Solved cornett • 30 days ago