NitinBot001 commited on
Commit
9445e08
·
verified ·
1 Parent(s): 50aeffb

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -0
Dockerfile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.9 slim as base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ libgl1-mesa-glx \
10
+ libglib2.0-0 \
11
+ libsm6 \
12
+ libxext6 \
13
+ libxrender-dev \
14
+ libgomp1 \
15
+ wget \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy requirements first for better caching
19
+ COPY requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Copy application files
25
+ COPY . .
26
+
27
+ # Create directory for model cache
28
+ RUN mkdir -p /root/.cache/carvekit
29
+
30
+ # Expose the port
31
+ EXPOSE 7860
32
+
33
+ # Set environment variables
34
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
35
+ ENV GRADIO_SERVER_PORT=7860
36
+ ENV PYTHONUNBUFFERED=1
37
+
38
+ # Health check
39
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
40
+ CMD curl -f http://localhost:7860/health || exit 1
41
+
42
+ # Run the application
43
+ CMD ["python", "app.py"]