sreepathi-ravikumar commited on
Commit
ab1c7fb
·
verified ·
1 Parent(s): b3b964d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -15
Dockerfile CHANGED
@@ -4,26 +4,26 @@ FROM python:3.11-slim
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system packages required
8
- RUN apt-get update && \
9
- apt-get install -y ffmpeg fonts-liberation tesseract-ocr && \
10
- apt-get clean && rm -rf /var/lib/apt/lists/*
11
-
12
- # Create required directories with proper permissions
13
- RUN mkdir -p /tmp/images /tmp/sound /tmp/video && chmod -R 777 /tmp
14
-
15
- # Copy requirements and install Python packages
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy the rest of your application code
20
  COPY app.py image_fetcher.py video.py video2.py ./
21
 
22
- # Expose your application port
23
- EXPOSE 7860
24
 
25
- # Add this before CMD
26
- ENV TMPDIR=/tmp
27
 
28
- # Run your Flask app
29
  CMD ["python", "app.py"]
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies in a single layer to reduce image size
8
+ RUN apt-get update && apt-get install -y \
9
+ ffmpeg \
10
+ fonts-liberation \
11
+ tesseract-ocr \
12
+ tesseract-ocr-tam \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Copy requirements.txt and install Python packages
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Copy the rest of the app
20
  COPY app.py image_fetcher.py video.py video2.py ./
21
 
22
+ # Create directories for video and audio with proper permissions
23
+ RUN mkdir -p /tmp/video /tmp/sound && chmod -R 777 /tmp/video /tmp/sound
24
 
25
+ # Expose port 7860 (as specified)
26
+ EXPOSE 7860
27
 
28
+ # Run the Flask app
29
  CMD ["python", "app.py"]