a month ago
Volume mount still not working after recreating volume.
Tried:
- Mount path: /data
- Start command: mkdir -p /data && sleep 10 && streamlit run...
- Deleted and recreated volume
- Multiple redeploys
Deploy logs consistently show:
Checking /data: exists=False, writable=False
The mkdir -p /data runs successfully (no errors) but
Railway mounts the volume AFTER the app starts checking.
Is there a known issue with volume mounting on Hobby plan
with Nixpacks builder?
19 Replies
Status changed to Open Railway • about 1 month ago
a month ago
I would highly recommend migrating to Dockerfile or Railpack as Nixpacks is deprecated.
0x5b62656e5d
I would highly recommend migrating to Dockerfile or Railpack as Nixpacks is deprecated.
a month ago
Thank you! I'm using Nixpacks because Railway auto-detected
it for my Python/Streamlit app.
Could you guide me on how to migrate to Dockerfile or
Railpack for a Streamlit app? Will this fix the volume
mounting issue?
a month ago
Hi, I think this reply might be for a different thread.
My issue is about Railway Volume not mounting for a
Python/Streamlit app. 😊
liluboutik-collab
Hi, I think this reply might be for a different thread. My issue is about Railway Volume not mounting for a Python/Streamlit app. 😊
a month ago
Took care of it.
liluboutik-collab
Thank you! I'm using Nixpacks because Railway auto-detected it for my Python/Streamlit app. Could you guide me on how to migrate to Dockerfile or Railpack for a Streamlit app? Will this fix the volume mounting issue?
a month ago
I'm not 100% sure it'll fix the mounting issue, but it might. (As Nixpacks is deprecated).
You can probably get an AI agent (like ChatGPT) to draft up a Dockerfile or a Railpack configuration for you based on your application.
You can refer to Railpack docs at https://railpack.com/getting-started if needed.
a month ago
Even with Dockerfile detected and ENTRYPOINT set,
Railway seems to be injecting STREAMLIT_SERVER_PORT=$PORT
before our entrypoint runs. The entrypoint never executes.
Custom start command also doesn't help.
Is Railway auto-generating a start command for Streamlit
apps that overrides the Dockerfile ENTRYPOINT?
a month ago
I'd try using CMD. Also, remove any custom start commands if you have one set.
0x5b62656e5d
I'd try using `CMD`. Also, remove any custom start commands if you have one set.
a month ago
Thank you! Removed the custom start command and
updated Dockerfile to use CMD instead of ENTRYPOINT.
Redeploying now — will update with results!
Status changed to Awaiting User Response Railway • about 1 month ago
0x5b62656e5d
I'd try using `CMD`. Also, remove any custom start commands if you have one set.
a month ago
Still getting same error after using CMD and removing
custom start command.
Even with ENV STREAMLIT_SERVER_PORT=8080 in Dockerfile,
Railway seems to be overriding it with $PORT (literal string).
Error: Invalid value for '--server.port'
(env var: 'STREAMLIT_SERVER_PORT'): '$PORT' is not a valid integer
Is Railway auto-injecting STREAMLIT_SERVER_PORT=$PORT
for Streamlit apps? How can we prevent this?
Status changed to Awaiting Railway Response Railway • about 1 month ago
0x5b62656e5d
What's your CMD command?
a month ago
CMD ["streamlit", "run", "layout.py"]
With ENV in Dockerfile:
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_PORT=8080
Full Dockerfile:
FROM python:3.11-slim
RUN mkdir -p /data
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_PORT=8080
CMD ["streamlit", "run", "layout.py"]
a month ago
Try CMD ["sh", "-c", "streamlit run layout.py --server.address=0.0.0.0 --server.port=${PORT:-8080}"].
0x5b62656e5d
Try `CMD ["sh", "-c", "streamlit run layout.py --server.address=0.0.0.0 --server.port=${PORT:-8080}"]`.
a month ago
Still same error with your suggested CMD:
CMD ["sh", "-c", "streamlit run layout.py
--server.address=0.0.0.0 --server.port=${PORT:-8080}"]
Error: Invalid value for '--server.port'
(env var: 'STREAMLIT_SERVER_PORT'): '$PORT'
is not a valid integer
It seems STREAMLIT_SERVER_PORT=$PORT is being injected
BEFORE our CMD runs and Streamlit reads the env var
before our CLI args can override it.
Is Railway auto-setting STREAMLIT_SERVER_PORT for
Streamlit apps? How can we clear it?
a month ago
Confirmed - STREAMLIT_SERVER_PORT is NOT in our variables.
Only Cloudinary vars exist. Railway must be auto-injecting it.
How do we prevent Railway from auto-setting
STREAMLIT_SERVER_PORT for Streamlit apps?
a month ago
Update: Confirmed STREAMLIT_SERVER_PORT is NOT in our
service variables. Only Cloudinary vars exist.
But Railway is still injecting STREAMLIT_SERVER_PORT=$PORT
(literal string) automatically.
Even tried ${{PORT}} reference syntax - still same error.
Our Dockerfile CMD:
CMD ["/bin/sh", "-c", "streamlit run layout.py
--server.port $PORT --server.address 0.0.0.0"]
The /bin/sh -c command never seems to execute at all.
Is there a way to see ALL environment variables that
Railway injects at runtime, including auto-generated ones?
Or is there a way to completely disable Railway's
auto-detection for Streamlit?
a month ago
Still same error after deleting STREAMLIT_SERVER_PORT
from variables and redeploying.
Railway must be auto-injecting STREAMLIT_SERVER_PORT=$PORT
internally for Streamlit apps even when not set in variables.
Our Dockerfile:
FROM python:3.11-slim
RUN mkdir -p /data
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
CMD ["/bin/sh", "-c", "streamlit run layout.py --server.port $PORT --server.address 0.0.0.0"]
No STREAMLIT_SERVER_PORT in variables.
Still getting: '$PORT' is not a valid integer
Is Railway auto-injecting this for Streamlit detection?
a month ago
Update: Resolved temporarily by reverting to Nixpacks.
The Dockerfile approach was failing because Railway was
auto-injecting STREAMLIT_SERVER_PORT=$PORT (literal string)
which Streamlit couldn't parse as an integer. Even hardcoding
STREAMLIT_SERVER_PORT=8080 in Dockerfile ENV and Railway
Variables was being overridden.
Workaround: Reverted to Nixpacks — app is now live at
Remaining issue: Railway Volume (/data) is not mounting
with Nixpacks. The /data directory shows exists=False
in deploy logs despite volume being attached.
Is there a way to use Nixpacks with a properly mounted
volume? Or fix the STREAMLIT_SERVER_PORT injection issue
so we can use Dockerfile builder with volume support?
Thank you for all the help!
a month ago
Any Luck