From 4347e7afc9ed7fec4f0ae29a70be15d888b40f70 Mon Sep 17 00:00:00 2001 From: Rajgupta36 Date: Wed, 20 Nov 2024 16:13:16 +0530 Subject: [PATCH 1/3] add docker ignore file --- frontend/.dockerignore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 frontend/.dockerignore diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..b0fa570 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,9 @@ +# Ignore node_modules +node_modules/ +# Ignore generated files +/dist +/src-tauri/target/ +/src-tauri/gen/schemas +# Ignore Git files +.git/ +.gitignore From a2c25232dcfd43afa8f383605f828d0830860f09 Mon Sep 17 00:00:00 2001 From: Rajgupta36 Date: Wed, 20 Nov 2024 16:16:21 +0530 Subject: [PATCH 2/3] remove build process in image;add layering for optimize building --- frontend/Dockerfile | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 20052e9..d9525ea 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,24 +4,24 @@ FROM ubuntu:22.04 # Install dependencies RUN apt-get update && \ apt-get install -y \ - curl \ - build-essential \ - libgtk-3-dev \ - libwebkit2gtk-4.0-dev \ - libappindicator3-dev \ - wget \ - xz-utils \ - libssl-dev \ - libglib2.0-dev \ - libgirepository1.0-dev \ - pkg-config \ - software-properties-common \ - libjavascriptcoregtk-4.0-dev \ - libjavascriptcoregtk-4.1-dev \ - libsoup-3.0-dev \ - libwebkit2gtk-4.1-dev \ - librsvg2-dev \ - file \ + curl \ + build-essential \ + libgtk-3-dev \ + libwebkit2gtk-4.0-dev \ + libappindicator3-dev \ + wget \ + xz-utils \ + libssl-dev \ + libglib2.0-dev \ + libgirepository1.0-dev \ + pkg-config \ + software-properties-common \ + libjavascriptcoregtk-4.0-dev \ + libjavascriptcoregtk-4.1-dev \ + libsoup-3.0-dev \ + libwebkit2gtk-4.1-dev \ + librsvg2-dev \ + file \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Install Node.js (Node.js 16 is compatible with Tauri) From 4c3a5059ad7a7f9a114e8c258fb1068ae581fd57 Mon Sep 17 00:00:00 2001 From: Rajgupta36 Date: Wed, 20 Nov 2024 17:11:49 +0530 Subject: [PATCH 3/3] layering --- frontend/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d9525ea..189d082 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -41,20 +41,14 @@ ARG TAURI_SIGNING_PRIVATE_KEY_PASSWORD # Copy the application source code to the container WORKDIR /app -COPY . . - +# Copy the package.json file +COPY package.json . # Install dependencies RUN npm install - +# Copy the rest of the code +COPY . . # Set environment variables using build arguments ENV TAURI_SIGNING_PRIVATE_KEY=$TAURI_SIGNING_PRIVATE_KEY ENV TAURI_SIGNING_PRIVATE_KEY_PASSWORD=$TAURI_SIGNING_PRIVATE_KEY_PASSWORD - -# Build the frontend (React app) -RUN npm run build - -# Build the Tauri application -RUN npm run tauri build -v - # Set the container's entrypoint to access the bundled files CMD ["bash"] \ No newline at end of file