File size: 1,253 Bytes
c40c447
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Dockerfile optimizado para HuggingFace Spaces
# Using new v3 architecture

FROM python:3.10-slim

# Environment variables
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PORT=7860 \
    MODEL_ID=amazon/chronos-2 \
    DEVICE_MAP=cpu

# Working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy application code (NEW v3 architecture)
COPY app/ ./app/

# Copy static files (Excel Add-in)
COPY static/ ./static/

# Copy docs (optional but good to have)
COPY docs/ ./docs/ 2>/dev/null || true

# Create non-root user
RUN useradd -m -u 1000 user && \
    chown -R user:user /app

USER user

# Expose port (HF Spaces uses 7860)
EXPOSE 7860

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
    CMD curl -f http://localhost:7860/health || exit 1

# Start command - USING NEW MAIN_V3
CMD ["uvicorn", "app.main_v3:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]