Wrong Dockerfile configuration on Deploy Streamlit using Docker docs page
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- docker, python
- Domain
- devops, documentation
Research direction
Open the Deploy Streamlit using Docker page and inspect the Dockerfile example around WORKDIR, git clone, and pip3 install. Build the documented example to confirm the reported failure and verify that the published instructions complete successfully with the intended working directory.
Written by the indexing model from the issue text.
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
Hey
Today by following the manual at Deploy Streamlit using Docker (https://docs.streamlit.io/knowledge-base/tutorials/deploy/docker) I run into the problem of setting a WORKDIR for the Docker.
The WORKDIR has to be moved after the RUN git clone method for the Docker to set the WORKDIR correctly. Otherwise, it results in Docker being unable to set the WORKDIR and default to running the commands in its directory.
This way the docker build fails at RUN pip3 install -r requirements.txt
Wrong version:
# app/Dockerfile
FROM python:3.9-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/streamlit/streamlit-example.git .
RUN pip3 install -r requirements.txt
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
Corrected version:
# app/Dockerfile
FROM python:3.9-slim
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/streamlit/streamlit-example.git .
WORKDIR /app
RUN pip3 install -r requirements.txt
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
ran
Reproducible Code Example
No response
Steps To Reproduce
No response
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version:
- Python version:
- Operating System:
- Browser:
Additional Information
No response
- Dominant language
- JavaScript
- Stars
- 178
- Forks
- 705
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 39
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamlit/docs
-
docs needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
docs needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
docs needs triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
bug needs triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100