diff --git a/Dockerfile.builder-linux b/Dockerfile.builder-linux new file mode 100644 index 0000000..b0423ea --- /dev/null +++ b/Dockerfile.builder-linux @@ -0,0 +1,39 @@ +FROM node:24-bookworm AS build +WORKDIR /workspace + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + file \ + libayatana-appindicator3-dev \ + libssl-dev \ + libwebkit2gtk-4.1-dev \ + libxdo-dev \ + patchelf \ + pkg-config \ + librsvg2-dev \ + wget \ + && rm -rf /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal +ENV PATH="/root/.cargo/bin:$PATH" + +COPY package.json ./ +RUN npm install + +COPY . . + +RUN node -e "const fs=require('fs'); const p='src-tauri/tauri.conf.json'; const c=JSON.parse(fs.readFileSync(p,'utf8')); c.bundle.createUpdaterArtifacts=false; fs.writeFileSync(p, JSON.stringify(c,null,2)+'\\n')" + +RUN npm run bundle:deb + +RUN set -eux; \ + mkdir -p /desktop-artifacts; \ + deb="$(find src-tauri/target/release/bundle/deb -maxdepth 1 -type f -name '*.deb' -print -quit)"; \ + test -n "$deb"; \ + cp "$deb" /desktop-artifacts/fieldlens-print-linux-x64.deb; \ + sha256sum /desktop-artifacts/fieldlens-print-linux-x64.deb > /desktop-artifacts/SHA256SUMS + +FROM nginx:1.27-alpine +COPY --from=build /desktop-artifacts /usr/share/nginx/html +EXPOSE 80