Yakova commited on
Commit
428ae71
·
verified ·
1 Parent(s): e475cf5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +83 -22
Dockerfile CHANGED
@@ -1,33 +1,94 @@
1
- FROM python:3.11-slim
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
- ENV WINEPREFIX=/root/.wine
 
5
  ENV WINEARCH=win64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- # Add i386 architecture & install Wine + Python deps
8
- RUN dpkg --add-architecture i386 && apt update && \
9
- apt install -y \
10
- wine64 wine32 winetricks wget cabextract curl \
11
- fonts-liberation ttf-mscorefonts-installer \
12
- git unzip && \
13
- rm -rf /var/lib/apt/lists/*
14
 
15
- # Install required Wine tricks for CapCut (even if we don’t run GUI)
16
- RUN winetricks --self-update && \
17
- winetricks vcrun2019 corefonts
18
 
19
- # Setup CapCut folder
20
- WORKDIR /app
21
- COPY . /app
22
 
23
- # Install pyJianYingDraft
24
- RUN pip install pyJianYingDraft
 
 
 
 
 
 
 
25
 
26
- # Download CapCut installer if needed
27
- RUN wget -O /app/CapCut_Installer.exe "https://example.com/CapCut_Installer.exe"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- # Optional: run installer in background
30
- # RUN wine start /wait /app/CapCut_Installer.exe /silent || true
31
 
 
 
32
 
33
- CMD [ "python3 " ]
 
1
+ FROM ubuntu:22.04
2
 
3
+ # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV WINEDEBUG=-all
6
+ ENV DISPLAY=:99
7
  ENV WINEARCH=win64
8
+ ENV WINEPREFIX=/root/.wine
9
+
10
+ # Install dependencies
11
+ RUN apt-get update && apt-get install -y \
12
+ software-properties-common \
13
+ apt-transport-https \
14
+ wget \
15
+ gnupg2 \
16
+ xvfb \
17
+ x11vnc \
18
+ fluxbox \
19
+ sudo \
20
+ cabextract \
21
+ xz-utils \
22
+ p7zip-full \
23
+ curl \
24
+ unzip \
25
+ && dpkg --add-architecture i386 \
26
+ && apt-get update
27
+
28
+ # Add Wine repository
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
+ # Configure Wine
38
+ RUN mkdir -p /root/.wine/user.reg.d
39
+ RUN echo '[Software\\\\Wine\\\\X11 Driver]' > /root/.wine/user.reg.d/graphics.reg \
40
+ && echo '"Decorated"="N"' >> /root/.wine/user.reg.d/graphics.reg \
41
+ && echo '"Managed"="N"' >> /root/.wine/user.reg.d/graphics.reg
42
 
43
+ # Set Wine to Windows 11
44
+ RUN wine reg add "HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\capcut.exe\\Version" /v Windows /t REG_SZ /d "win11" /f
 
 
 
 
 
45
 
46
+ # Install required Windows components using winetricks
47
+ RUN winetricks -q vcrun2019 corefonts
 
48
 
49
+ # Create directory for CapCut files
50
+ RUN mkdir -p /opt/capcut
 
51
 
52
+ # Download and install CapCut
53
+ RUN mkdir -p /tmp/capcut-download \
54
+ && cd /tmp/capcut-download \
55
+ && wget -O capcut_setup.exe "https://lf16-capcut.faceulv.com/obj/capcutpc-packages-us/packages/CapCut_setup_9.9.0_capcutpc_0_us.exe" \
56
+ && echo "Extracting CapCut installer..." \
57
+ && wine capcut_setup.exe /S /D=C:\\CapCut \
58
+ && sleep 10 \
59
+ && cp -r "$WINEPREFIX/drive_c/CapCut/"* /opt/capcut/ \
60
+ && rm -rf /tmp/capcut-download
61
 
62
+ # Entry point script
63
+ RUN echo '#!/bin/bash \n\
64
+ # Start virtual display \n\
65
+ Xvfb :99 -screen 0 1920x1080x24 & \n\
66
+ sleep 2 \n\
67
+ # Start window manager \n\
68
+ fluxbox -display :99 & \n\
69
+ # Optionally start VNC server if you want to connect and see what\'s happening \n\
70
+ x11vnc -display :99 -forever -nopw & \n\
71
+ # Copy any custom CapCut files if mounted \n\
72
+ if [ -d "/capcut-custom" ]; then \n\
73
+ cp -r /capcut-custom/* /opt/capcut/ \n\
74
+ fi \n\
75
+ # Set aspect ratio to fix black preview issue \n\
76
+ if [ -f "/opt/capcut/capcut.exe" ]; then \n\
77
+ # Change project aspect ratio to fix black screen issue \n\
78
+ wine reg add "HKEY_CURRENT_USER\\Software\\ByteDance\\CapCut" /v "AspectRatio" /t REG_SZ /d "16:9" /f \n\
79
+ fi \n\
80
+ # Run CapCut with parameters if provided \n\
81
+ cd /opt/capcut \n\
82
+ if [ $# -eq 0 ]; then \n\
83
+ wine capcut.exe \n\
84
+ else \n\
85
+ wine capcut.exe "$@" \n\
86
+ fi \n\
87
+ ' > /entrypoint.sh
88
 
89
+ RUN chmod +x /entrypoint.sh
 
90
 
91
+ # Expose VNC port if needed
92
+ EXPOSE 5900
93
 
94
+ ENTRYPOINT ["/entrypoint.sh"]