diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora new file mode 100644 index 00000000..f70adeec --- /dev/null +++ b/docker/Dockerfile.fedora @@ -0,0 +1,34 @@ +FROM fedora:43 + +# Install system dependencies for Tauri v2 +RUN dnf update -y && \ + dnf install -y \ + gcc \ + gcc-c++ \ + make \ + pkg-config \ + openssl-devel \ + webkit2gtk4.1-devel \ + javascriptcoregtk4.1-devel \ + libsoup3-devel \ + librsvg2-devel \ + curl \ + wget \ + git \ + rpm-build \ + rpmdevtools \ + && dnf clean all + +# Install Node.js (LTS version) +RUN dnf install -y nodejs npm && dnf clean all + +# Install pnpm +RUN npm install -g pnpm + +# Install Rust toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +# Set working directory +WORKDIR /app + diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu new file mode 100644 index 00000000..88cb7b73 --- /dev/null +++ b/docker/Dockerfile.ubuntu @@ -0,0 +1,33 @@ +FROM ubuntu:24.04 + +# Install system dependencies for Tauri v2 +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + wget \ + git \ + pkg-config \ + libssl-dev \ + libwebkit2gtk-4.1-dev \ + librsvg2-dev \ + libsoup-3.0-dev \ + libayatana-appindicator3-dev \ + libseccomp-dev \ + liblcms2-dev \ + libkrb5-dev \ + patchelf \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Node.js (LTS version) +RUN apt-get update && apt-get install -y nodejs npm && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install pnpm +RUN npm install -g pnpm + +# Install Rust toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +# Set working directory +WORKDIR /app + diff --git a/docker/build-fedora.sh b/docker/build-fedora.sh new file mode 100755 index 00000000..4120894f --- /dev/null +++ b/docker/build-fedora.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +# Get the directory where this script is located +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + +# Build the Docker image +echo "Building Docker image (Fedora)..." +docker build -f "$SCRIPT_DIR/Dockerfile.fedora" -t quantframe-react:fedora "$PROJECT_ROOT" + +# Run the container with the project mounted and build inside +echo "Building application in container..." +docker run --rm \ + -v "$PROJECT_ROOT:/app" \ + -v quantframe-cargo-cache:/root/.cargo \ + quantframe-react:fedora \ + bash -c "cd /app && pnpm install --frozen-lockfile && pnpm tauri build --bundles rpm" + +echo "" +echo " - RPM packages: src-tauri/target/release/bundle/rpm/" +echo " - Binary: src-tauri/target/release/" +echo " - Node modules: ./node_modules" +echo " - Rust build cache: ./src-tauri/target" + diff --git a/docker/build-ubuntu.sh b/docker/build-ubuntu.sh new file mode 100755 index 00000000..5a05d969 --- /dev/null +++ b/docker/build-ubuntu.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +# Get the directory where this script is located +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + +# Build the Docker image +echo "Building Docker image (Ubuntu)..." +docker build -f "$SCRIPT_DIR/Dockerfile.ubuntu" -t quantframe-react:ubuntu "$PROJECT_ROOT" + +# Run the container with the project mounted and build inside +echo "Building application in container..." +docker run --rm \ + -v "$PROJECT_ROOT:/app" \ + -v quantframe-cargo-cache:/root/.cargo \ + quantframe-react:ubuntu \ + bash -c "cd /app && pnpm install --frozen-lockfile && pnpm tauri build --bundles deb" + +echo "" +echo " - DEB packages: src-tauri/target/release/bundle/deb/" +echo " - Binary: src-tauri/target/release/" +echo " - Node modules: ./node_modules" +echo " - Rust build cache: ./src-tauri/target" +