Spaces:
Sleeping
Sleeping
| # Streamlit on a Docker HF Space (the org disallows the native streamlit SDK). | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # HF Spaces serves on port 7860. | |
| ENV PORT=7860 \ | |
| STREAMLIT_SERVER_PORT=7860 \ | |
| STREAMLIT_SERVER_ADDRESS=0.0.0.0 \ | |
| STREAMLIT_SERVER_HEADLESS=true \ | |
| HOME=/app \ | |
| HF_HOME=/app/.cache/huggingface \ | |
| DATA_DIR=/app/data | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Brings in app.py, dashboard.py, prewarm.py — but NOT the eval data, which is | |
| # private and never committed to this public Space repo. | |
| COPY . . | |
| EXPOSE 7860 | |
| # Fetch the private eval data into DATA_DIR (needs the HF_TOKEN Space secret), | |
| # THEN launch Streamlit. The fetch is a small targeted slice that completes | |
| # before the app serves, so visitors read it as a local path — no download on | |
| # the request path. app.py is exec_dashboard.py; dashboard.py sits beside it. | |
| CMD ["sh", "-c", "python prewarm.py; streamlit run app.py --server.port=7860 --server.address=0.0.0.0"] | |