Python 3.11 requires VCRUNTIME140.dll (VC++ 2019 runtime) which is not present in the default Wine prefix; without it python.exe fails with STATUS_DLL_NOT_FOUND (exit code 53).
51 lines
1.6 KiB
Docker
51 lines
1.6 KiB
Docker
FROM node:22.14.0-bookworm
|
|
|
|
ENV WINEPREFIX=/root/.wine
|
|
ENV WINEDEBUG=-all
|
|
|
|
# System dependencies + Wine + Xvfb
|
|
RUN dpkg --add-architecture i386 && \
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
wine wine64 \
|
|
python3 python3-pip python3-venv libpython3.11 \
|
|
binutils wget xvfb xauth winetricks ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy repo
|
|
COPY . .
|
|
|
|
# Python venv (Linux, for local tools only)
|
|
RUN python3 -m venv venv && \
|
|
venv/bin/pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Bootstrap Wine prefix
|
|
RUN wineboot --init 2>/dev/null || true
|
|
|
|
# Install Visual C++ 2019 runtime (required by Python 3.11)
|
|
RUN xvfb-run winetricks -q vcrun2019
|
|
|
|
# Install Python for Windows under Wine (silent, no GUI)
|
|
RUN wget -q "https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe" -O /tmp/py.exe && \
|
|
xvfb-run wine /tmp/py.exe /quiet InstallAllUsers=1 PrependPath=1 TargetDir="C:\\Python311" && \
|
|
rm /tmp/py.exe
|
|
|
|
# Install Python deps + PyInstaller under Wine Python
|
|
RUN xvfb-run wine "C:\\Python311\\python.exe" -m pip install --no-cache-dir -r requirements.txt pyinstaller
|
|
|
|
# Compile Python CLI into Windows binary
|
|
RUN xvfb-run wine "C:\\Python311\\python.exe" -m PyInstaller \
|
|
--onefile --name cli src/cli.py && \
|
|
mkdir -p frontend/resources && \
|
|
cp dist/cli.exe frontend/resources/cli.exe
|
|
|
|
# JS dependencies + electron-builder
|
|
RUN cd frontend && npm ci && npm install --no-save electron-builder
|
|
|
|
# Build Windows NSIS installer
|
|
RUN cd frontend && npx vite build && npx electron-builder --win nsis --publish never
|
|
|
|
# Export installer
|
|
CMD cp frontend/release/*.exe /out/
|