The Streamlit application inside a Docker container is not running or the port is not working, there could be several potential issues at play. @AndiMajore could you please have a look at these potential solutions just to be completely sure it's not a code problem? Mahdi told me about the port 8501 by default so maybe it's about this.
Expose the Correct Port: Make sure to expose the port that Streamlit is running on (by default, it's 8501). In your Dockerfile, add the following line:
EXPOSE 8501
Run the Docker Container with Port Mapping: When running the Docker container, map the internal port to an external port using the -p flag:
docker run -p 8501:8501 your_image_name
Configure Streamlit for Network Access: If the app is still not accessible, it might be related to Streamlit's networking configuration. You can set the --server.address parameter to 0.0.0.0 to allow connections from outside the container:
CMD streamlit run --server.address 0.0.0.0 app.py
Check for Errors: Look at the Docker container logs to check for any errors:
docker logs your_container_id
Firewall and Security Rules: Ensure that there are no firewall or security rules blocking access to the port you're using.
1.Check the Browser and URL: Try accessing the app using different browsers or ensure that you are accessing the correct URL, typically http://localhost:8501.
The Streamlit application inside a Docker container is not running or the port is not working, there could be several potential issues at play. @AndiMajore could you please have a look at these potential solutions just to be completely sure it's not a code problem? Mahdi told me about the port 8501 by default so maybe it's about this.
Expose the Correct Port: Make sure to expose the port that Streamlit is running on (by default, it's 8501). In your Dockerfile, add the following line:
Run the Docker Container with Port Mapping: When running the Docker container, map the internal port to an external port using the -p flag:
Configure Streamlit for Network Access: If the app is still not accessible, it might be related to Streamlit's networking configuration. You can set the --server.address parameter to 0.0.0.0 to allow connections from outside the container:
Check for Errors: Look at the Docker container logs to check for any errors:
Firewall and Security Rules: Ensure that there are no firewall or security rules blocking access to the port you're using. 1.Check the Browser and URL: Try accessing the app using different browsers or ensure that you are accessing the correct URL, typically http://localhost:8501.