Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +33 -30
Dockerfile
CHANGED
|
@@ -1,31 +1,34 @@
|
|
| 1 |
-
# Use official Python image as base
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Install system dependencies (including libgl1 for OpenCV and Node.js)
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
-
git \
|
| 10 |
-
curl \
|
| 11 |
-
libgl1 \
|
| 12 |
-
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
| 13 |
-
&& apt-get install -y nodejs \
|
| 14 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
-
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
#
|
|
|
|
|
|
|
|
|
|
| 31 |
CMD ["node", "server.js"]
|
|
|
|
| 1 |
+
# Use official Python image as base
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies (including libgl1 for OpenCV and Node.js)
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
curl \
|
| 11 |
+
libgl1 \
|
| 12 |
+
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
| 13 |
+
&& apt-get install -y nodejs \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Ensure /data/uploads exists and is writable
|
| 17 |
+
RUN mkdir -p /data/uploads && chmod -R 777 /data
|
| 18 |
+
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
COPY requirements.txt .
|
| 21 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
+
|
| 23 |
+
# Install Node.js dependencies
|
| 24 |
+
COPY package*.json ./
|
| 25 |
+
RUN npm install --omit=dev
|
| 26 |
+
|
| 27 |
+
# Copy the rest of your backend code
|
| 28 |
+
COPY . .
|
| 29 |
+
|
| 30 |
+
# Expose the port your Node.js server runs on (Hugging Face expects 7860)
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# Start the Node.js backend
|
| 34 |
CMD ["node", "server.js"]
|