This commit is contained in:
brontomark committed 2026-11-22 10:47:38 +01:00
1 parent 08aeaa3f42
commit 58b9a8543f
4 files changed
+205 -21

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail
SRC_DIR="/tmp/barcode-src"
OUT_APPIMAGE="/workspace/BarcodeServer-x86_64.AppImage"
rm -rf "${SRC_DIR}"
mkdir -p "${SRC_DIR}/server"
tar -C /workspace/server \
--exclude='./venv' \
--exclude='./venv_unix' \
--exclude='./venv_win' \
--exclude='./build' \
--exclude='./dist' \
--exclude='./__pycache__' \
--exclude='./.DS_Store' \
-cf - . | tar -C "${SRC_DIR}/server" -xf -
cd "${SRC_DIR}"
BUILD_ARGS=(server/build_binary.py --onedir --windowed --appdir)
if [ -n "${APP_VERSION:-}" ]; then
BUILD_ARGS+=(--version "${APP_VERSION}")
fi
python "${BUILD_ARGS[@]}"
ARCH=x86_64 appimagetool \
"${SRC_DIR}/server/dist/BarcodeServer.AppDir" \
"${OUT_APPIMAGE}"
chmod +x "${OUT_APPIMAGE}"
APPIMAGE_EXTRACT_AND_RUN=1 "${OUT_APPIMAGE}" --version
if [ -n "${HOST_UID:-}" ] && [ -n "${HOST_GID:-}" ]; then
chown "${HOST_UID}:${HOST_GID}" "${OUT_APPIMAGE}"
fi
+62
View File
@@ -0,0 +1,62 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
binutils \
ca-certificates \
curl \
file \
libdbus-1-3 \
libegl1 \
libfontconfig1 \
libgl1 \
libglib2.0-0 \
libx11-6 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xinerama0 \
libxcb-xkb1 \
libxkbcommon0 \
libxkbcommon-x11-0 \
libxtst6 \
patchelf \
python3 \
python3-dev \
python3-pip \
python3-venv \
tar \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# Pre-crea il venv Python e installa le dipendenze in cache layer Docker
RUN python3 -m venv /opt/venv
ENV VIRTUAL_ENV="/opt/venv"
ENV PATH="/opt/venv/bin:${PATH}"
COPY server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /tmp/requirements.txt pyinstaller \
&& rm -f /tmp/requirements.txt
# Estrae appimagetool per funzionare senza FUSE dentro Docker
RUN curl -fsSL -o /tmp/appimagetool.AppImage \
https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage \
&& chmod +x /tmp/appimagetool.AppImage \
&& cd /opt \
&& /tmp/appimagetool.AppImage --appimage-extract \
&& mv /opt/squashfs-root /opt/appimagetool \
&& ln -s /opt/appimagetool/AppRun /usr/local/bin/appimagetool \
&& rm -f /tmp/appimagetool.AppImage
COPY docker/build-linux-appimage.sh /usr/local/bin/build-linux-appimage.sh
RUN chmod +x /usr/local/bin/build-linux-appimage.sh
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/build-linux-appimage.sh"]