dunkindonuts123 commited on
Commit
f55edbb
·
1 Parent(s): 124c441

add Dockerfile and dockerignore to backend

Browse files
Files changed (2) hide show
  1. .dockerignore +3 -0
  2. Dockerfile +19 -0
.dockerignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ __pycache__
2
+ *.pyc
3
+ .env
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # System deps for OpenCV / cv2
6
+ RUN apt-get update && apt-get install -y \
7
+ libglib2.0-0 libsm6 libxrender1 libxext6 libgl1 \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy only backend folder contents
11
+ COPY backend/requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ COPY backend/ .
15
+
16
+ # HF Spaces MUST use port 7860
17
+ EXPOSE 7860
18
+
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]