From 787cb10e215534143050993751c8bf23acae5330 Mon Sep 17 00:00:00 2001 From: tebarius Date: Tue, 9 Dec 2025 23:23:39 +0100 Subject: [PATCH] - pump streamlit to v1.52.1 - pump numpy to v2.3.5 - run container with --- Dockerfile | 19 ++++++----- examples.py | 84 ----------------------------------------------- requirements.txt | Bin 260 -> 264 bytes 3 files changed, 11 insertions(+), 92 deletions(-) delete mode 100644 examples.py diff --git a/Dockerfile b/Dockerfile index 8d5c121..82f9ff7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,27 +5,30 @@ LABEL description="tebarius Mysteryhelfer web" WORKDIR /app -RUN apt-get update \ - && apt-get install -y curl \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends curl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN python -m pip install --upgrade pip COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt - COPY ./app /app +RUN python -m pip install --upgrade pip \ + && pip install --no-cache-dir -r requirements.txt + + # ein bisschen Patchen um auch beim Bookmarken oder Versenden der Webadresse per Messenger den richtigen Titel und das # richtige Favicon zu verwenden/sehen COPY ./app/images/favicon.ico /usr/local/lib/python3.13/site-packages/streamlit/static/favicon.ico RUN sed -i -e 's|favicon\.png|favicon.ico|' \ -e 's|.*|tebarius Mysteryhelfer (web)|' \ - /usr/local/lib/python3.13/site-packages/streamlit/static/index.html - + /usr/local/lib/python3.13/site-packages/streamlit/static/index.html \ + && useradd -m -u 1000 myst \ + && chown -R myst:myst /app +USER myst EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health -ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] diff --git a/examples.py b/examples.py deleted file mode 100644 index 6208d5c..0000000 --- a/examples.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (c) 2025 Martin Kayser (tebarius) -# Licensed under the MIT License. See LICENSE file in the project root. -# start with: streamlit run examples.py -import streamlit as st - - -st.write("# Hello World !") - - -import pandas as pd -df = pd.DataFrame({ - 'first column': [1, 2, 3, 4], - 'second column': [10, 20, 30, 40] -}) -df - - -st.table(df) - - -import pandas as pd -st.map(pd.DataFrame({'lat':[52.3642], 'lon':[13.0906]}), zoom=17, size=5) - - -import streamlit as st -x = st.slider('x', 32, 233) # 👈 this is a widget -st.write(x, 'squared is', x * x) - - -st.text_input("Your name", key="name") -# You can access the value at any point with: -st.session_state.name - - -import numpy as np -import pandas as pd - -if st.checkbox('Show dataframe'): - chart_data = pd.DataFrame( - np.random.randn(20, 3), - columns=['a', 'b', 'c']) - chart_data - - -import pandas as pd -df = pd.DataFrame({ - 'first column': [1, 2, 3, 4], - 'second column': [10, 20, 30, 40] - }) -option = st.selectbox( - 'Which number do you like best?', - df['first column']) -'You selected: ', option - - -add_selectbox = st.sidebar.selectbox( - 'How would you like to be contacted?', - ('Email', 'Home phone', 'Mobile phone') -) -# Add a slider to the sidebar: -add_slider = st.sidebar.slider( - 'Select a range of values', - 0.0, 100.0, (25.0, 75.0) -) - -add_selectbox -add_slider - - -left_column, right_column = st.columns(2) -# You can use a column just like st.sidebar: -left_column.button('Press me!') -# Or even better, call Streamlit functions inside a "with" block: -with right_column: - chosen = st.radio( - 'Sorting hat', - ("Gryffindor", "Ravenclaw", "Hufflepuff", "Slytherin")) - st.write(f"You are in {chosen} house!") - - -st.progress(80) - -st.text_area("Your text", key="te") -st.session_state.te diff --git a/requirements.txt b/requirements.txt index 497e1e1e49d47fc8da40f223f07455a38fa69853..f2a518b56d60745658c9491a492a02c76762819e 100644 GIT binary patch delta 22 dcmZo+>R_56$7;l&$6z>7`97N|11|#?0{}U=1Udi! delta 18 ZcmeBRYGIln$7;x+$6zo~`96~g0{|$@1RMYW