Spaces:
Sleeping
Sleeping
Download Dockerfile from shkumar156/Backend-Object-Detection: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/spaces/shkumar156/Backend-Object-Detection/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/shkumar156/Backend-Object-Detection/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/shkumar156/Backend-Object-Detection/resolve/main/Dockerfile
888 Bytes
| # 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"] |