Skip to content

Commit b0bac48

Browse files
committed
debugging the app
1 parent b0ac15b commit b0bac48

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ RUN apt-get update -q && \
1212

1313
WORKDIR /app
1414

15+
# Force unbuffered Python output so logs appear immediately in HF Spaces
16+
ENV PYTHONUNBUFFERED=1
17+
1518
# Install Python dependencies first (layer-cached unless requirements change)
1619
COPY requirements-dashboard.txt requirements.txt
1720
RUN pip install --no-cache-dir --upgrade pip && \
1821
pip install --no-cache-dir -r requirements.txt
1922

20-
# Copy application code.
23+
# Copy application code
2124
COPY app.py .
2225
COPY scripts/ scripts/
2326

@@ -27,4 +30,4 @@ USER appuser
2730

2831
EXPOSE 7860
2932

30-
CMD ["python", "app.py"]
33+
CMD ["python", "app.py"]

app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import sys
2+
sys.stdout = sys.__stdout__ # ensure unbuffered output in HF Spaces container
3+
14
"""
25
Environmental Monitoring Dashboard
36
Dash app for Hugging Face Spaces — reads from S3 via DataReader.

0 commit comments

Comments
 (0)