Redfire-1234 commited on
Commit
45a1c37
·
verified ·
1 Parent(s): 2996e44

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies for OpenCV
6
+ RUN apt-get update && apt-get install -y \
7
+ libgl1-mesa-glx \
8
+ libglib2.0-0 \
9
+ libsm6 \
10
+ libxext6 \
11
+ libxrender-dev \
12
+ libgomp1 \
13
+ ffmpeg \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Copy and install Python dependencies
17
+ COPY ./backend/requirements.txt /app/requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade pip && \
19
+ pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy application files
22
+ COPY ./backend /app/backend
23
+ COPY ./frontend /app/frontend
24
+
25
+ # Create necessary directories
26
+ RUN mkdir -p /app/uploads /app/outputs
27
+
28
+ # Set environment variables
29
+ ENV PYTHONUNBUFFERED=1
30
+
31
+ # Expose port
32
+ EXPOSE 7860
33
+
34
+ # Run the application
35
+ CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]