sreepathi-ravikumar commited on
Commit
9f5d49c
·
verified ·
1 Parent(s): 3cfbac1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,22 +1,24 @@
1
- # Use official Python base image
2
  FROM python:3.11-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy requirements.txt and install Python packages
 
 
 
 
 
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy the rest of the app
12
  COPY app.py image_fetcher.py video.py video2.py ./
13
- RUN apt-get update && apt-get install -y ffmpeg
14
- RUN apt-get update && apt-get install -y fonts-liberation
15
- RUN apt-get update && apt-get install -y tesseract-ocr
16
 
 
 
17
 
18
- # Expose port 5000 (Flask default)
19
- EXPOSE 7860
20
 
21
- # Run the Flask app
22
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies first
6
+ RUN apt-get update && \
7
+ apt-get install -y ffmpeg tesseract-ocr fonts-liberation && \
8
+ apt-get clean
9
+
10
+ # Copy requirements and install Python deps
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Copy your application code
15
  COPY app.py image_fetcher.py video.py video2.py ./
 
 
 
16
 
17
+ # Make sure these temp folders exist
18
+ RUN mkdir -p /tmp/images /tmp/sound /tmp/video
19
 
20
+ # Set environment variables if needed (e.g., for Tesseract)
21
+ ENV PYTHONUNBUFFERED=1
22
 
23
+ EXPOSE 7860
24
  CMD ["python", "app.py"]