File size: 891 Bytes
e3a0aff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Python as the base image to support heavy AI libraries
FROM python:3.11-slim

# Install system dependencies and Node.js 20
RUN apt-get update && apt-get install -y curl \
    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /app

# 1. Setup Backend
COPY backend/requirements.txt ./backend/
RUN pip install --no-cache-dir -r backend/requirements.txt

# 2. Setup Frontend
COPY frontend/package*.json ./frontend/
RUN cd frontend && npm install

# 3. Copy the rest of the application code
COPY . .

# 4. Build the Next.js application
RUN cd frontend && npm run build

# 5. Make the startup script executable
RUN chmod +x /app/start.sh

# Hugging Face Spaces strictly requires port 7860
EXPOSE 7860

# Run the startup script
CMD ["/app/start.sh"]