Spaces:
Sleeping
Sleeping
Chandima Prabhath
commited on
Commit
·
0388d92
1
Parent(s):
4cda7a3
Update Dockerfile to install FFmpeg and implement output directory cleanup in video encoding task
Browse files- Dockerfile +3 -0
- video_encoder/worker/tasks.py +1 -1
Dockerfile
CHANGED
|
@@ -6,6 +6,9 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
|
|
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Install FFmpeg
|
| 10 |
+
RUN apt-get update && apt-get install -y ffmpeg
|
| 11 |
+
|
| 12 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
video_encoder/worker/tasks.py
CHANGED
|
@@ -35,4 +35,4 @@ def encode_video_task(job_id: str, input_path: str) -> Optional[str]:
|
|
| 35 |
raise
|
| 36 |
finally:
|
| 37 |
# Cleanup temporary files after 1 hour
|
| 38 |
-
|
|
|
|
| 35 |
raise
|
| 36 |
finally:
|
| 37 |
# Cleanup temporary files after 1 hour
|
| 38 |
+
shutil.rmtree(output_dir, ignore_errors=True)
|