Update Dockerfile
Browse files- Dockerfile +1 -150
Dockerfile
CHANGED
@@ -25,153 +25,4 @@ RUN apt-get update && apt-get install -y \
|
|
25 |
&& dpkg --add-architecture i386 \
|
26 |
&& apt-get update
|
27 |
|
28 |
-
|
29 |
-
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key \
|
30 |
-
&& apt-key add winehq.key \
|
31 |
-
&& add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ jammy main' \
|
32 |
-
&& apt-get update
|
33 |
-
|
34 |
-
# Install Wine and winetricks
|
35 |
-
RUN apt-get install -y --install-recommends winehq-devel winetricks
|
36 |
-
|
37 |
-
# Create XDG_RUNTIME_DIR to avoid errors
|
38 |
-
RUN mkdir -p /tmp/runtime-root && chmod 700 /tmp/runtime-root
|
39 |
-
|
40 |
-
# Initialize wine
|
41 |
-
RUN Xvfb :99 -screen 0 1024x768x16 & \
|
42 |
-
sleep 2 && \
|
43 |
-
DISPLAY=:99 wine wineboot --init && \
|
44 |
-
wineserver -w
|
45 |
-
|
46 |
-
# Configure Wine settings
|
47 |
-
RUN Xvfb :99 -screen 0 1024x768x16 & \
|
48 |
-
sleep 2 && \
|
49 |
-
DISPLAY=:99 winecfg -v win11 && \
|
50 |
-
# Disable window manager decorations and control
|
51 |
-
echo '[Software\\\\Wine\\\\X11 Driver]' > /tmp/graphics.reg && \
|
52 |
-
echo '"Decorated"="N"' >> /tmp/graphics.reg && \
|
53 |
-
echo '"Managed"="N"' >> /tmp/graphics.reg && \
|
54 |
-
DISPLAY=:99 wine regedit /tmp/graphics.reg && \
|
55 |
-
rm /tmp/graphics.reg && \
|
56 |
-
wineserver -w
|
57 |
-
|
58 |
-
# Install Windows components using winetricks
|
59 |
-
RUN Xvfb :99 -screen 0 1024x768x16 & \
|
60 |
-
sleep 2 && \
|
61 |
-
DISPLAY=:99 winetricks -q vcrun2019 && \
|
62 |
-
DISPLAY=:99 winetricks -q corefonts && \
|
63 |
-
wineserver -w
|
64 |
-
|
65 |
-
# Create directory for CapCut files
|
66 |
-
RUN mkdir -p /opt/capcut
|
67 |
-
|
68 |
-
# Download and install CapCut
|
69 |
-
RUN mkdir -p /tmp/capcut-download \
|
70 |
-
&& cd /tmp/capcut-download \
|
71 |
-
&& wget -O capcut_setup.exe "https://lf16-capcut.faceulv.com/obj/capcutpc-packages-us/packages/CapCut_setup_9.9.0_capcutpc_0_us.exe" \
|
72 |
-
&& echo "Extracting CapCut installer..." \
|
73 |
-
&& Xvfb :99 -screen 0 1024x768x16 & \
|
74 |
-
sleep 2 && \
|
75 |
-
DISPLAY=:99 wine capcut_setup.exe /S /D=C:\\CapCut \
|
76 |
-
&& sleep 30 \
|
77 |
-
&& wineserver -w \
|
78 |
-
&& cp -r "$WINEPREFIX/drive_c/CapCut/"* /opt/capcut/ 2>/dev/null || true \
|
79 |
-
&& rm -rf /tmp/capcut-download
|
80 |
-
|
81 |
-
# Create a headless command script for CapCut operations
|
82 |
-
RUN echo '#!/bin/bash \n\
|
83 |
-
# Function to run a CapCut command with proper setup \n\
|
84 |
-
run_capcut_command() { \n\
|
85 |
-
# Create runtime directory \n\
|
86 |
-
mkdir -p $XDG_RUNTIME_DIR \n\
|
87 |
-
chmod 700 $XDG_RUNTIME_DIR \n\
|
88 |
-
\n\
|
89 |
-
# Start virtual display in background \n\
|
90 |
-
Xvfb :99 -screen 0 1920x1080x24 & \n\
|
91 |
-
XVFB_PID=$! \n\
|
92 |
-
sleep 2 \n\
|
93 |
-
\n\
|
94 |
-
# Set aspect ratio to fix black preview issue \n\
|
95 |
-
echo "[HKEY_CURRENT_USER\\\\Software\\\\ByteDance\\\\CapCut]" > /tmp/capcut_settings.reg \n\
|
96 |
-
echo "\"AspectRatio\"=\"16:9\"" >> /tmp/capcut_settings.reg \n\
|
97 |
-
DISPLAY=:99 wine regedit /tmp/capcut_settings.reg \n\
|
98 |
-
rm /tmp/capcut_settings.reg \n\
|
99 |
-
\n\
|
100 |
-
# Run the command \n\
|
101 |
-
cd /opt/capcut \n\
|
102 |
-
DISPLAY=:99 wine capcut.exe $@ \n\
|
103 |
-
\n\
|
104 |
-
# Clean up \n\
|
105 |
-
kill $XVFB_PID \n\
|
106 |
-
} \n\
|
107 |
-
\n\
|
108 |
-
# Process input and project files if mounted \n\
|
109 |
-
if [ -d "/input" ]; then \n\
|
110 |
-
cp -r /input/* /opt/capcut/projects/ 2>/dev/null || true \n\
|
111 |
-
fi \n\
|
112 |
-
\n\
|
113 |
-
# Handle command line arguments \n\
|
114 |
-
case "$1" in \n\
|
115 |
-
"process") \n\
|
116 |
-
# Example: Process a project file \n\
|
117 |
-
if [ -n "$2" ]; then \n\
|
118 |
-
PROJECT_FILE="$2" \n\
|
119 |
-
OUTPUT_PATH="${3:-/output}" \n\
|
120 |
-
echo "Processing project: $PROJECT_FILE" \n\
|
121 |
-
run_capcut_command --headless --process "$PROJECT_FILE" --output "$OUTPUT_PATH" \n\
|
122 |
-
else \n\
|
123 |
-
echo "Error: No project file specified" \n\
|
124 |
-
exit 1 \n\
|
125 |
-
fi \n\
|
126 |
-
;; \n\
|
127 |
-
"export") \n\
|
128 |
-
# Example: Export a project \n\
|
129 |
-
if [ -n "$2" ]; then \n\
|
130 |
-
PROJECT_FILE="$2" \n\
|
131 |
-
OUTPUT_PATH="${3:-/output}" \n\
|
132 |
-
echo "Exporting project: $PROJECT_FILE" \n\
|
133 |
-
run_capcut_command --headless --export "$PROJECT_FILE" --output "$OUTPUT_PATH" \n\
|
134 |
-
else \n\
|
135 |
-
echo "Error: No project file specified" \n\
|
136 |
-
exit 1 \n\
|
137 |
-
fi \n\
|
138 |
-
;; \n\
|
139 |
-
"render") \n\
|
140 |
-
# Example: Render a project \n\
|
141 |
-
if [ -n "$2" ]; then \n\
|
142 |
-
PROJECT_FILE="$2" \n\
|
143 |
-
OUTPUT_PATH="${3:-/output}" \n\
|
144 |
-
echo "Rendering project: $PROJECT_FILE" \n\
|
145 |
-
run_capcut_command --headless --render "$PROJECT_FILE" --output "$OUTPUT_PATH" \n\
|
146 |
-
else \n\
|
147 |
-
echo "Error: No project file specified" \n\
|
148 |
-
exit 1 \n\
|
149 |
-
fi \n\
|
150 |
-
;; \n\
|
151 |
-
"custom") \n\
|
152 |
-
# Run custom CapCut command \n\
|
153 |
-
shift \n\
|
154 |
-
echo "Running custom command: $@" \n\
|
155 |
-
run_capcut_command $@ \n\
|
156 |
-
;; \n\
|
157 |
-
*) \n\
|
158 |
-
# Default: Just run CapCut with provided arguments \n\
|
159 |
-
echo "Running CapCut with arguments: $@" \n\
|
160 |
-
run_capcut_command $@ \n\
|
161 |
-
;; \n\
|
162 |
-
esac \n\
|
163 |
-
' > /usr/local/bin/capcut-cli
|
164 |
-
|
165 |
-
RUN chmod +x /usr/local/bin/capcut-cli
|
166 |
-
|
167 |
-
# Create output directory
|
168 |
-
RUN mkdir -p /output
|
169 |
-
|
170 |
-
# Create directories for projects
|
171 |
-
RUN mkdir -p /opt/capcut/projects
|
172 |
-
|
173 |
-
# Set the entrypoint to our headless command script
|
174 |
-
ENTRYPOINT ["/usr/local/bin/capcut-cli"]
|
175 |
-
|
176 |
-
# Default command (can be overridden)
|
177 |
-
CMD ["--help"]
|
|
|
25 |
&& dpkg --add-architecture i386 \
|
26 |
&& apt-get update
|
27 |
|
28 |
+
CMD python3.10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|