sreepathi-ravikumar commited on
Commit
84308e2
·
verified ·
1 Parent(s): 7ba61d6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends \
8
+ gcc \
9
+ python3-dev \
10
+ ffmpeg \
11
+ libimage-exiftool-perl \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements first for caching
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Application code
19
+ COPY app.py text2generation.py video_processor.py ./
20
+
21
+ # Environment variables
22
+ ENV TRANSFORMERS_CACHE=/tmp/cache \
23
+ HF_HOME=/tmp/cache \
24
+ PYTHONUNBUFFERED=1
25
+
26
+ # Create cache directory
27
+ RUN mkdir -p /tmp/cache && \
28
+ chmod 777 /tmp/cache
29
+
30
+ EXPOSE 7860
31
+
32
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \
33
+ CMD curl -f http://localhost:7860/health || exit 1
34
+
35
+ CMD ["python", "app.py"]