File size: 951 Bytes
e067c2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d578cb2
e067c2d
d578cb2
e067c2d
 
 
d578cb2
e067c2d
 
 
 
d578cb2
 
5d491ed
 
 
d578cb2
 
 
e067c2d
d578cb2
e067c2d
 
 
 
 
 
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
# Simple Hugging Face Spaces Dockerfile
FROM node:20-slim

ENV DEBIAN_FRONTEND=noninteractive

# Install Python
RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 \
    python3-pip \
    python3-venv \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy and build frontend
COPY frontend/package*.json ./frontend/
RUN cd frontend && npm ci
COPY frontend/ ./frontend/
RUN cd frontend && npm run build

# Copy and install backend
COPY backend/ ./backend/
RUN pip3 install --no-cache-dir --break-system-packages \
    fastapi uvicorn pydantic pydantic-settings \
    httpx psutil python-dotenv websockets

# Simple startup script
COPY start.sh /app/

# Fix permissions for node user
RUN chown -R node:node /app && chmod +x /app/start.sh

# Switch to node user (UID 1000 already exists in node image)
USER node

ENV HOME=/home/node \
    PYTHONPATH=/app/backend \
    PYTHONUNBUFFERED=1

EXPOSE 7860

CMD ["/app/start.sh"]