Update Dockerfile
Browse files- 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
|
8 |
-
RUN apt-get update && \
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
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
|
20 |
COPY app.py image_fetcher.py video.py video2.py ./
|
21 |
|
22 |
-
#
|
23 |
-
|
24 |
|
25 |
-
#
|
26 |
-
|
27 |
|
28 |
-
# Run
|
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"]
|