Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Prevent Python from writing .pyc files and enable unbuffered logging | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| ENV HOST=0.0.0.0 | |
| ENV DEBUG=False | |
| WORKDIR /app | |
| # Install system dependencies (needed for statsmodels/arch/pandas compilation if any) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create HF Space compatible user (UID 1000) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user | |
| ENV PATH=/home/user/.local/bin:$PATH | |
| # Copy application files (with correct permissions) | |
| COPY --chown=user:user src/ ./src/ | |
| COPY --chown=user:user dashboard/ ./dashboard/ | |
| COPY --chown=user:user data/ ./data/ | |
| COPY --chown=user:user quarto-web/ ./quarto-web/ | |
| # Expose the port HF Spaces expects | |
| EXPOSE 7860 | |
| # Start the dashboard application | |
| CMD ["python", "dashboard/app.py"] | |