File size: 888 Bytes
b93e9bd
 
 
 
 
 
534d2e1
b93e9bd
 
 
 
534d2e1
b93e9bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5373b2b
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 official Python image as base
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies (including libgl1, libglib2.0-0 for OpenCV and Node.js)
RUN apt-get update && apt-get install -y \
    git \
    curl \
    libgl1 \
    libglib2.0-0 \
    && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
    && apt-get install -y nodejs \
    && rm -rf /var/lib/apt/lists/*

# Ensure /data/uploads exists and is writable
RUN mkdir -p /data/uploads && chmod -R 777 /data

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install Node.js dependencies
COPY package*.json ./
RUN npm install --omit=dev

# Copy the rest of your backend code
COPY . .

# Expose the port your Node.js server runs on (Hugging Face expects 7860)
EXPOSE 7860

# Start the Node.js backend
CMD ["node", "server.js"]