Madras1 commited on
Commit
19e26d7
·
verified ·
1 Parent(s): 19ea065

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies for edge-tts
7
+ RUN apt-get update && apt-get install -y \
8
+ --no-install-recommends \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt .
13
+
14
+ # Install Python dependencies
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Copy application code
18
+ COPY app.py .
19
+
20
+ # Expose port (HuggingFace 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 httpx; httpx.get('http://localhost:7860/health')" || exit 1
26
+
27
+ # Run the application
28
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]