File size: 1,049 Bytes
81fe24b
 
 
 
 
 
 
 
 
 
 
 
8b3905d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81fe24b
8b3905d
 
 
 
 
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
# Hugging Face Spaces (Docker): API + static Next.js dashboard at /ui/
FROM node:22-alpine AS frontend_build
WORKDIR /build/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend ./
ENV NEXT_TELEMETRY_DISABLED=1 \
    NEXT_STATIC_EXPORT=1 \
    NEXT_PUBLIC_BASE_PATH=/ui \
    NEXT_PUBLIC_API_URL=
RUN npm run build

FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONPATH=/app \
    SKIP_DB=1 \
    SKIP_LANGGRAPH_WARMUP=1 \
    ENABLE_MOCK_CLOUD_POLL=1 \
    COLLECTOR_WATCH_DIR=/app/demo_logs \
    CORS_ORIGINS="*"

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libpq-dev \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

COPY . /app
COPY --from=frontend_build /build/frontend/out /app/frontend/out

RUN mkdir -p /app/demo_logs

EXPOSE 7860
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]