FROM python:3.13.5-slim RUN useradd -m -u 1000 user WORKDIR /app COPY --chown=user requirements.txt ./ COPY --chown=user src/ ./src/ RUN pip3 install --no-cache-dir -r requirements.txt EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] # # Create non-root user that matches Spaces runtime (uid 1000), set HOME # # Install deps as the user # COPY --chown=user requirements.txt . # RUN pip install --no-cache-dir -r requirements.txt # # Copy app code with correct ownership # COPY --chown=user . . # # Optional: project config; Streamlit also reads $CWD/.streamlit/config.toml # # (this avoids reliance on ~/.streamlit) # # COPY --chown=user .streamlit $HOME/app/.streamlit # EXPOSE 8501 # ENTRYPOINT ["streamlit","run","app.py","--server.port=8501","--server.address=0.0.0.0"]