From 7ef309a2460c6c274dd39dd26f01530aac23f110 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Mon, 17 Jun 2024 15:31:01 +0200 Subject: [PATCH] doc: Go in production with bonita-ui-builder --- modules/applications/applications-nav.adoc | 1 + .../package-and-deploy-your-application.adoc | 47 ++++++++++- .../pages/production-packaging.adoc | 83 +++++++++++++++++++ 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 modules/applications/pages/production-packaging.adoc diff --git a/modules/applications/applications-nav.adoc b/modules/applications/applications-nav.adoc index 22212d7c35..5139028717 100644 --- a/modules/applications/applications-nav.adoc +++ b/modules/applications/applications-nav.adoc @@ -6,6 +6,7 @@ **** xref:interact-with-your-bonita-process.adoc[Interact with your Bonita process] **** xref:builder-declare-interface-in-bonita.adoc[Declare the interface into Bonita] **** xref:package-and-deploy-your-application.adoc[Package and deploy your application] + ***** xref:production-packaging.adoc[Production packaging] **** xref:next-steps.adoc[Next steps] *** xref:how-tos-builder.adoc[How-tos] *** xref:resources.adoc[Resources] diff --git a/modules/applications/pages/package-and-deploy-your-application.adoc b/modules/applications/pages/package-and-deploy-your-application.adoc index 791e2dd92d..53cf52871b 100644 --- a/modules/applications/pages/package-and-deploy-your-application.adoc +++ b/modules/applications/pages/package-and-deploy-your-application.adoc @@ -1,7 +1,52 @@ = Package and deploy your application -:description: +:description: Step-by-step guide to transition from development to production using Bonita UI Builder [NOTE] ==== For Subscription editions only. ==== + +== Prerequisites + +Before starting, ensure you have **Docker** the following tools installed on your system: + +== Steps to Move from Development to Production + +=== 1. Design Your Application + +Begin by designing your application using xref:download-and-launch.adoc[Bonita UI Builder]. + +=== 2. Export Your Application + +Once the design is complete, export the application(s) from Bonita UI Builder. This export will be used for building the production binary. + +=== 3. Store Your Application in a Workspace Folder + +Place the exported application(s) in a designated `workspace` folder. This folder will be referenced during the build process. +You can store these applications in a Git repository too. + +=== 4. Build the Production Binary + +To create the production-ready binary, you need to build a Docker image. This image will contain the application(s) and the Bonita UI Builder runtime. + +The xref:applications:production-packaging.adoc#dockerfile[Dockerfile] and more details and information on how to build the Docker image can be found in this xref:applications:production-packaging.adoc[dedicated page]. + +=== 5. Run the Docker Image + +After building the Docker image, run it using the following command: + +[source,shell] +---- +docker run --name bonita-ui bonita-ui:1.0.0 +---- + +=== 6. Access to your Application + +Once Bonita UI Builder is ready, all applications contained in the dedicated folder will be: +- Imported +- Published +- Made available for users + +Then, these applications can be accessed from the bonita application directory + +=== diff --git a/modules/applications/pages/production-packaging.adoc b/modules/applications/pages/production-packaging.adoc new file mode 100644 index 0000000000..0077d498ad --- /dev/null +++ b/modules/applications/pages/production-packaging.adoc @@ -0,0 +1,83 @@ += Build the SCA UI +:description: Procedure to build the SCA UI docker image +:bonitappsmith_version: 0.0.1-SNAPSHOT +:docker_url: bonitasoft.jfrog.io/docker-snapshots/bonita-ui-builder + +NOTE: You need to have Docker installed on your machine to build the SCA UI. + +[[dockerfile]] +== Dockerfile + +Add this Dockerfile to the root of your project: + +[source,docker] +---- +ARG VERSION=0.0.1-SNAPSHOT +ARG BASE=bonitasoft.jfrog.io/docker-snapshots/bonita-ui-builder +FROM ${BASE}:${VERSION} + +# Create an argument for the workspace folder location (a folder with the applications json inside) +ARG WORKSPACE=./workspace/ +# Arbitrary workspace folder location inside the docker image +ENV BONITA_APPLICATION_FOLDER_PATH=/workspace/applications/ + +RUN mkdir -p ${BONITA_APPLICATION_FOLDER_PATH} +COPY ${WORKSPACE} ${BONITA_APPLICATION_FOLDER_PATH} + +EXPOSE 80 +EXPOSE 443 +ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ] +HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/opt/appsmith/healthcheck.sh" +CMD ["/usr/bin/supervisord", "-n"] +---- + + +== SCA Docker image + +* Copy the Dockerfile +* From Bonitappsmith, export all applications and store them in the an `workspace` folder next to the Dockerfile. + +NOTE: You can name the folder as you want and store it where you want, but you need to update the `WORKSPACE` build argument with the new path folder. + +=== Simple use case + +* Run this following command to build the SCA-UI docker image. With this command, the image will be built with the default values. + +[source,bash] +---- + docker build -t bonita-ui:1.0.0 . +---- + +=== Advanced use case + +You can override some default values by using the following build arguments: + +[cols="1,1,1"] +|=== +|Args | Description | Default value + +|BASE |The base image to use | {docker_url}:{bonitappsmith_version} +|VERSION |The version of image to use | {bonitappsmith_version} +|WORKSPACE | The folder containing the apps descriptor | ./workspace/ +|=== + +[source,bash] +---- + docker build --build-arg "BASE=bonitasoft.jfrog.io/docker-snapshots/bonita-ui-builder" \ + --build-arg "VERSION=0.0.1-SNAPSHOT" \ + --build-arg "WORKSPACE=./workspace/" \ + -t test-sca-ui:0.0.1 . +---- + +=== Run the SCA UI docker image + +To run the SCA-UI docker image, you can use the following command: + +[source,bash] +---- + docker run --name bonita-ui -p 8080:80 bonita-ui:1.0.0 -e BONITA_API_URL=http://localhost:8080/bonita/api +---- + + + +