The Docker container fails to start with the error:
Error: Invalid value: File does not exist: app.py
This is caused by the Dockerfile having a path mismatch issue:
WORKDIR /app sets the working directory to /app
COPY copies the entire repository, creating the /app/demobuilder/ subdirectory
CMD ["streamlit", "run", "app.py", ...] tries to run app.py from /app
But app.py is actually located at /app/demobuilder/app.py
The fix consists in updating the Dockerfile CMD to use the correct path:
# Run the application - Fixed path to app.py in demobuilder subdirectory
CMD streamlit run demobuilder/app.py \
--server.port=8501 \
--server.address=0.0.0.0 \
--server.headless=true \
--server.enableCORS=false \
--server.enableXsrfProtection=false
Steps to Reproduce
- Build the Docker image:
docker build -t demobuilder:latest -f demobuilder/Dockerfile .
- Run the container:
docker run -d --name demobuilder -p 8501:8501 demobuilder:latest
This issue affects Docker deployments but not OpenShift S2I deployments. The S2I process handles the file structure differently. The fix has been implemented and tested locally.
The Docker container fails to start with the error:
This is caused by the Dockerfile having a path mismatch issue:
WORKDIR /appsets the working directory to/appCOPYcopies the entire repository, creating the/app/demobuilder/subdirectoryCMD ["streamlit", "run", "app.py", ...]tries to runapp.pyfrom/appBut
app.pyis actually located at/app/demobuilder/app.pyThe fix consists in updating the Dockerfile CMD to use the correct path:
Steps to Reproduce
docker build -t demobuilder:latest -f demobuilder/Dockerfile .docker run -d --name demobuilder -p 8501:8501 demobuilder:latestThis issue affects Docker deployments but not OpenShift S2I deployments. The S2I process handles the file structure differently. The fix has been implemented and tested locally.