File size: 1,105 Bytes
495cc95
 
 
 
f20c3be
495cc95
 
 
 
9bf0054
 
f20c3be
495cc95
 
f20c3be
495cc95
 
f20c3be
 
 
495cc95
 
 
f20c3be
9bf0054
495cc95
f20c3be
 
 
 
 
495cc95
9bf0054
495cc95
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

# System deps
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    ca-certificates \
    gnupg \
  && rm -rf /var/lib/apt/lists/*

# ---------- Backend deps ----------
COPY newnew_AI/backend/requirements.txt /app/backend/requirements.txt
RUN pip install --no-cache-dir -r /app/backend/requirements.txt

# ---------- Copy project ----------
COPY newnew_AI/backend /app/backend
COPY newnew_AI/frontend /app/frontend

# ---------- Build frontend ----------
WORKDIR /app/frontend
RUN test -f package.json || (echo "ERROR: /app/frontend/package.json not found" && ls -la && exit 1)

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
  && apt-get update && apt-get install -y nodejs \
  && node -v && npm -v \
  && if [ -f package-lock.json ]; then npm ci --no-audit --no-fund; else npm install --no-audit --no-fund; fi \
  && npm run build \
  && rm -rf /var/lib/apt/lists/*

# ---------- Run API ----------
WORKDIR /app
ENV PORT=7860
EXPOSE 7860

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