| FROM python:3.13-slim |
|
|
| WORKDIR /workspace |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential curl git && \ |
| rm -rf /var/lib/apt/lists/* |
|
|
| |
| ENV PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 \ |
| PIP_NO_CACHE_DIR=1 \ |
| STREAMLIT_HOME=/tmp \ |
| STREAMLIT_TELEMETRY_ENABLED=false |
|
|
| |
| COPY requirements.txt ./requirements.txt |
| RUN pip install -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| ENV PORT=7860 |
|
|
| |
| CMD bash -lc '\ |
| echo "===== Application Startup ====="; \ |
| echo "CWD: $(pwd)"; \ |
| echo "--- top level ---"; ls -lah; \ |
| echo "--- python files (depth 2) ---"; find . -maxdepth 2 -type f -name "*.py" -print; \ |
| APP_FILE=""; \ |
| for f in "streamlit_app.py" "src/streamlit_app.py" "app.py" "src/app.py"; do \ |
| if [ -f "$f" ]; then APP_FILE="$f"; break; fi; \ |
| done; \ |
| if [ -z "$APP_FILE" ]; then \ |
| echo "ERROR: Could not find streamlit entry file (tried streamlit_app.py, src/streamlit_app.py, app.py, src/app.py)"; \ |
| exit 1; \ |
| fi; \ |
| echo "Starting Streamlit on $PORT using $APP_FILE"; \ |
| streamlit run "$APP_FILE" \ |
| --server.address 0.0.0.0 \ |
| --server.port "$PORT" \ |
| --server.headless true \ |
| --server.enableCORS false \ |
| --server.enableXsrfProtection false \ |
| --browser.gatherUsageStats false \ |
| --server.fileWatcherType none \ |
| ' |
|
|