Spaces:
Running
Running
Commit
·
72458c1
1
Parent(s):
8e908fb
update: dockerfile ffmpeg issue
Browse files- Dockerfile +9 -6
Dockerfile
CHANGED
@@ -1,23 +1,26 @@
|
|
1 |
-
FROM python:3.9
|
2 |
|
3 |
# Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
imagemagick \
|
7 |
-
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
# Create directories with proper permissions
|
10 |
WORKDIR /app
|
11 |
RUN mkdir -p /app/resources/{temp_video,audio,fonts,intro} \
|
12 |
-
&& chmod -R
|
13 |
|
14 |
# Set up temp directory with proper permissions
|
15 |
RUN mkdir -p /tmp/moviepy \
|
16 |
-
&& chmod -R
|
|
|
|
|
|
|
17 |
|
18 |
# Copy and install requirements
|
19 |
COPY requirements.txt .
|
20 |
-
RUN pip install -r requirements.txt
|
21 |
|
22 |
# Copy application code
|
23 |
COPY . .
|
@@ -40,7 +43,7 @@ RUN echo '<policymap> \
|
|
40 |
# Set proper permissions
|
41 |
RUN chown -R nobody:nogroup /app \
|
42 |
&& chmod -R 755 /app \
|
43 |
-
&& chmod -R
|
44 |
|
45 |
# Use non-root user
|
46 |
USER nobody
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
|
3 |
# Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
imagemagick \
|
7 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
# Create directories with proper permissions
|
10 |
WORKDIR /app
|
11 |
RUN mkdir -p /app/resources/{temp_video,audio,fonts,intro} \
|
12 |
+
&& chmod -R 755 /app/resources
|
13 |
|
14 |
# Set up temp directory with proper permissions
|
15 |
RUN mkdir -p /tmp/moviepy \
|
16 |
+
&& chmod -R 1777 /tmp/moviepy # Use 1777 for sticky bit on temp directories
|
17 |
+
|
18 |
+
# Set TMPDIR environment variable
|
19 |
+
ENV TMPDIR=/tmp/moviepy
|
20 |
|
21 |
# Copy and install requirements
|
22 |
COPY requirements.txt .
|
23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
24 |
|
25 |
# Copy application code
|
26 |
COPY . .
|
|
|
43 |
# Set proper permissions
|
44 |
RUN chown -R nobody:nogroup /app \
|
45 |
&& chmod -R 755 /app \
|
46 |
+
&& chmod -R 1777 /tmp
|
47 |
|
48 |
# Use non-root user
|
49 |
USER nobody
|