File size: 1,347 Bytes
a60c3ce
 
 
 
 
ad4e7df
a60c3ce
 
 
270e671
a60c3ce
 
 
270e671
ad4e7df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a60c3ce
 
270e671
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad4e7df
 
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
43
44
45
46
47
48
49
50
51
52
53
FROM ubuntu:22.04

# Set non-interactive frontend to avoid prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install OpenShot and dependencies, including XCB libs and Xvfb
RUN apt-get update && apt-get install -y \
    openshot-qt \
    python3-pyqt5 \
    python3-pip \
    libx11-6 \
    libxrender1 \
    libgl1-mesa-glx \
    libpulse0 \
    xvfb \
    libx11-xcb1 \
    libxcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxext6 \
    libxfixes3 \
    libxi6 \
    libxrandr2 \
    libxss1 \
    libxtst6 \
    libxcb-xinerama0 \
    libxcb-xinput0 \
    libxcb-keysyms1 \
    libxcb-cursor0 \
    libxcb-util1 \
    libxkbcommon-x11-0 \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user and set up home directory
RUN useradd -m -s /bin/bash openshotuser && \
    chown -R openshotuser:openshotuser /home/openshotuser

# Switch to non-root user
USER openshotuser

# Set home directory environment variable
ENV HOME=/home/openshotuser

# Ensure OpenShot's configuration directory is writable
RUN mkdir -p /home/openshotuser/.openshot_qt && \
    chmod -R 755 /home/openshotuser/.openshot_qt

# Ensure Python can find OpenShot modules
ENV PYTHONPATH=/usr/lib/python3/dist-packages:/usr/lib/python3/dist-packages/openshot_qt

# Run OpenShot with Xvfb for headless virtual display
CMD ["xvfb-run", "-a", "openshot-qt"]