First up - thank you, the Streamlit app is great and very helpful to get ideas to production quickly.
We’re using Digital Ocean’s app platform to deploy Streamlit. As part of this, we’re using their HTTP Routes feature to deploy to a “subfolder” path (eg http://my.domain.com/streamlit). They deploy Streamlit via a Docker container to this path, and we don’t have any control over the webserver beyond this. We have got this working OK via the command line option --server.baseUrlPath=/streamlit
Our problem:
- Streamlit’s asset path is prepended with a “
.
” (eghref="./favicon.png"
) - This works fine when the app is at root (
/
) or a URL terminated with a slash - It doesn’t work using DO’s default serving method of leaving the final forward slash off the url and it doesn’t resolve these paths correctly. The dot makes it go looking up a level to the root of the domain, which it would do if there was just a forward slash in the path.
A possible solution is to either override this behaviour within Streamlit via a command line option or via editable templates that work with a Dockerfile pipeline (where we can’t edit the source of deployed code).
Is this possible at all, or has anyone got a workaround? Other than telling users to add the slash themselves, which doesn’t scale.