Vignesh-19 commited on
Commit
ff9ec77
·
verified ·
1 Parent(s): 8136dcf

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies needed for OpenCV, PyTorch, etc.
4
+ RUN apt-get update && apt-get install -y \
5
+ libgl1 \
6
+ libglib2.0-0 \
7
+ git-lfs \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set up a new user named "user" with user ID 1000
11
+ RUN useradd -m -u 1000 user
12
+ USER user
13
+ ENV PATH="/home/user/.local/bin:$PATH"
14
+
15
+ WORKDIR /app
16
+
17
+ # Install dependencies first (for faster caching)
18
+ COPY --chown=user requirements.txt .
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Copy the rest of the application
23
+ COPY --chown=user . .
24
+
25
+ # Expose port (Hugging Face Spaces routes external traffic to 7860)
26
+ EXPOSE 7860
27
+
28
+ # Command to run the Fastapi app
29
+ CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "7860"]