Rakshitjan commited on
Commit
f9b13f5
·
verified ·
1 Parent(s): 401b8f3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ gcc \
8
+ python3-dev \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements and install Python dependencies
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy application code
16
+ COPY . .
17
+
18
+ # Create necessary directories
19
+ RUN mkdir -p /app/output
20
+
21
+ # Expose port
22
+ EXPOSE 7860
23
+
24
+ # Health check
25
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
26
+ CMD curl -f http://localhost:7860/health || exit 1
27
+
28
+ # Run the application
29
+ CMD ["python", "main.py"]