RafzE commited on
Commit
515a804
·
verified ·
1 Parent(s): 787265d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ gcc \
7
+ g++ \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set working directory
11
+ WORKDIR /app
12
+
13
+ # Copy requirements first for better caching
14
+ COPY requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Copy application code
18
+ COPY . .
19
+
20
+ # Expose port (Hugging Face uses 7860)
21
+ EXPOSE 7860
22
+
23
+ # Health check
24
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
25
+ CMD python -c "import requests; requests.get('http://localhost:7860/health')"
26
+
27
+ # Run the app
28
+ CMD ["python", "app.py"]