- Add explicit hidden imports/collect rules for coincurve, bip_utils and src modules - Introduce Docker smoke tests for hd_generate and p2pkh to fail fast on missing runtime deps - Refactor cli.py to lazy-load command modules and avoid global startup crashes from optional deps - Use pseudo-TTY script wrapper for Wine smoke tests to prevent Invalid handle failures
55 lines
1.7 KiB
Docker
55 lines
1.7 KiB
Docker
FROM node:22.14.0-bookworm
|
|
|
|
# System dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 python3-pip python3-venv libpython3.11 \
|
|
binutils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy repo
|
|
COPY . .
|
|
|
|
# Python venv + dependencies
|
|
RUN python3 -m venv venv && \
|
|
venv/bin/pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Compile Python CLI into a standalone binary
|
|
RUN venv/bin/pip install --no-cache-dir pyinstaller && \
|
|
venv/bin/pyinstaller \
|
|
--onefile --name cli \
|
|
--hidden-import _cffi_backend \
|
|
--hidden-import coincurve._cffi_backend \
|
|
--hidden-import src.crypto \
|
|
--hidden-import src.hd_wallet \
|
|
--hidden-import src.p2pk \
|
|
--hidden-import src.p2pkh \
|
|
--hidden-import src.p2sh \
|
|
--hidden-import src.p2wpkh \
|
|
--hidden-import src.p2tr \
|
|
--hidden-import src.single_wallet \
|
|
--collect-data bip_utils \
|
|
--collect-submodules src \
|
|
--collect-submodules coincurve \
|
|
--collect-binaries coincurve \
|
|
--collect-data coincurve \
|
|
src/cli.py && \
|
|
dist/cli hd_generate '{}' > /tmp/cli-hd-generate.json && \
|
|
cat /tmp/cli-hd-generate.json && \
|
|
grep -Eq '"ok"[[:space:]]*:[[:space:]]*true' /tmp/cli-hd-generate.json && \
|
|
dist/cli p2pkh '{}' > /tmp/cli-p2pkh.json && \
|
|
cat /tmp/cli-p2pkh.json && \
|
|
grep -Eq '"ok"[[:space:]]*:[[:space:]]*true' /tmp/cli-p2pkh.json && \
|
|
mkdir -p frontend/resources && \
|
|
cp dist/cli frontend/resources/cli
|
|
|
|
# JS dependencies + electron-builder
|
|
RUN cd frontend && npm ci && npm install --no-save electron-builder
|
|
|
|
# Build
|
|
RUN cd frontend && npx vite build && npx electron-builder --linux AppImage --publish never
|
|
|
|
# Export AppImage
|
|
CMD cp frontend/release/*.AppImage /out/
|