ottog.eth
ottog.eth
RRailway
Created by ottog.eth on 2/9/2024 in #✋|help
Streamlit - Docker App
Hello, I'm testing how to deploy a Python Streamlit app using docker. I have tested locally and it works, however I'm having an issue where I cannot access the actual website. This is my docker file:
FROM python:3.9-slim-bullseye

ARG PORT

WORKDIR /app

RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*

COPY . .

RUN pip3 install -r requirements.txt

EXPOSE $PORT

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "app.py","--server.port=$PORT","--server.address=0.0.0.0"]
FROM python:3.9-slim-bullseye

ARG PORT

WORKDIR /app

RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*

COPY . .

RUN pip3 install -r requirements.txt

EXPOSE $PORT

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "app.py","--server.port=$PORT","--server.address=0.0.0.0"]
I have set the $PORT variable in railway. It deploys sucessfully but when it's trying to excecute the streamlit app it gives me this error:
Error: Invalid value for '--server.port': '$PORT' is not a valid integer.

Usage: streamlit run [OPTIONS] TARGET [ARGS]...
Error: Invalid value for '--server.port': '$PORT' is not a valid integer.

Usage: streamlit run [OPTIONS] TARGET [ARGS]...
15 replies