Streamlit App rendering navigation twice inside Docker Container

My streamlit app is deployed on GCP using cloud run. I notice when I run the app locally the sidebar navigation renders correctly, but when I deploy the app I get double navigation. How do I get the navigation to render correctly inside my container?

the entry point for my app is app.py

import streamlit as st
from pages.explore import explore_page
from pages.pe import pe_page
from pages.simulate import simulate_page

st.set_page_config(
    page_title="Profound Earnings",
    page_icon="πŸ“ˆ",
    layout="wide",
    initial_sidebar_state="expanded",
    menu_items=None
)
# Define the pages
PAGES = {
    "Simulate": simulate_page,
    "Analyze": pe_page,
    "Explore": explore_page,
    #"Test": test_page
    
    
}

files = ["temp/data_pool.h5", "temp/coint_pvalues.pickle","temp/data.pickle"]

for file in files:
            if vbt.file_exists(file):
             vbt.remove_file(file, missing_ok=True)
# Sidebar for navigation with buttons
st.sidebar.title('Navigation')

# Initialize session state for page selection
if 'page' not in st.session_state:
    st.session_state.page = 'Simulate'

# Function to create a full-width button
def sidebar_button(label):
    html_button = f'''
    <style>
    div.stButton > button:first-child {{
        width: 100%;
    }}
    </style>
    '''
    st.sidebar.markdown(html_button, unsafe_allow_html=True)
    return st.sidebar.button(label)

# Navigation buttons
if sidebar_button('Explore'):
    st.session_state.page = 'Explore'
if sidebar_button('Analyze'):
    st.session_state.page = 'Analyze'
if sidebar_button('Simulate'):
    st.session_state.page = 'Simulate'
# if sidebar_button('Test'):
#     st.session_state.page = 'Test'

# Add a horizontal bar
st.sidebar.markdown('---')

# Display the selected page
page = PAGES[st.session_state.page]
page()

The default navigation widget is hidden through a configuration setting. Does your deployed app have a copy of your config.toml file?

Yes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.