diff --git a/README.md b/README.md index 9e9f3c0f..8b477c17 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,20 @@ TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass npm run tauri build ``` +#### Running the Dockerfile + +To build the Docker image, use the following command: +```bash +docker build --build-arg TAURI_SIGNING_PRIVATE_KEY= --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD= -t . +``` +Replace and with your actual Tauri signing private key and password and with the image name. If you are using the default key, you can use the following command: + +```bash +docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass -t . +``` +This command uses the preset private key and password. + + ### Python Backend Setup #### Installation Steps diff --git a/docs/frontend/setup.md b/docs/frontend/setup.md index ae6063a4..87c6b9a0 100644 --- a/docs/frontend/setup.md +++ b/docs/frontend/setup.md @@ -80,6 +80,19 @@ This will create an optimized build of your application in the `src-tauri/target Learn more about building Tauri apps in the [Tauri Building Guide](https://tauri.app/v1/guides/building/). +#### Running the Dockerfile + +To build the Docker image, use the following command: +```bash +docker build --build-arg TAURI_SIGNING_PRIVATE_KEY= --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD= -t . +``` +Replace and with your actual Tauri signing private key and password and with the image name. If you are using the default key, you can use the following command: + +```bash +docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass -t . +``` +This command uses the preset private key and password. + ## Troubleshooting If you encounter any issues during setup or running the application: diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 00000000..3746fc36 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,58 @@ +# Use Ubuntu 22.04 as the base image +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 \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Node.js (Node.js 16 is compatible with Tauri) +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ + apt-get install -y nodejs + +# Install Rust +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install Tauri CLI +RUN npm install -g @tauri-apps/cli + +# Define build arguments +ARG TAURI_SIGNING_PRIVATE_KEY +ARG TAURI_SIGNING_PRIVATE_KEY_PASSWORD + +# Copy the application source code to the container +WORKDIR /app +COPY . . + +# Install dependencies +RUN npm install + +# 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