Hey there awesome people!
I have built and containerised a streamlit app and I am trying to serve it from http://myawsome.domain/myapp
via ngnix. (I’m taking things slowly, will look into SSL after I get it running).
Thanks to the following topics, I have been able to serve the app from http://myawesome.domain
:
but I just cannot serve it from http://myawesome.domain/myapp
!
I am pretty new to both Streamlit and nginx, so please bear with me. I am clearly missing something, but I cannot put my finger on it. Therefore, I seek help and guidance from the community
/etc/nginx/conf.d/app.conf:
server {
listen 80;
server_name myawesome.domain;
# streamlit config
location /tesla {
proxy_pass http://container_name:8501/;
}
location ^~ /static {
proxy_pass http://container_name:8501/static/;
}
location ^~ /healthz {
proxy_pass http://container_name:8501/healthz;
}
location ^~ /vendor {
proxy_pass http://container_name:8501/vendor;
}
location /stream {
proxy_pass http://container_name:8501/stream;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
}
./Dockerfile:
FROM python:3.10-slim
WORKDIR /app
RUN pip install pipenv
COPY Pipfile* .
RUN pipenv install --system --deploy --ignore-pipfile
COPY . /app
CMD ["/bin/bash", "-c", "streamlit run main.py --server.address 0.0.0.0"]
./.streamlit/config.toml
[server]
port = 8501
baseUrlPath = "/myapp"
enableCORS = false