-
Notifications
You must be signed in to change notification settings - Fork 504
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (35 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (35 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# PySceneDetect: Python-Based Video Scene Detector
# -------------------------------------------------------------------
# [ Site: https://scenedetect.com ]
# [ Docs: https://scenedetect.com/docs/ ]
# [ Github: https://github.com/Breakthrough/PySceneDetect/ ]
#
# Copyright (C) 2014-2026 Brandon Castellano <http://www.bcastell.com>.
# PySceneDetect is licensed under the BSD 3-Clause License; see the
# included LICENSE file, or visit one of the above pages for details.
#
FROM python:3.11.11-slim
# Create a non-root user for security hardening
RUN useradd -m scenedetect
# Set working directory and copy files with correct ownership
WORKDIR /app
COPY --chown=scenedetect:scenedetect . .
# Install necessary system dependencies as root first
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
# Install the scenedetect-headless variant: full program (CLI + opencv-python-headless)
# with the optional media backends. The repo root pyproject builds scenedetect-core
# (library only, no CLI), so swap in the headless variant pyproject first.
# pyav is highly recommended for faster/more robust video decodes
# moviepy provides an alternative video splitting backend
RUN --mount=type=cache,target=/root/.cache/pip \
cp packaging/variants/pyproject-scenedetect-headless.toml pyproject.toml && \
pip install ".[pyav,moviepy]"
# Switch to the non-root user
USER scenedetect
# The default behavior is to run the CLI
ENTRYPOINT ["scenedetect"]