Skip to content

Commit

Permalink
doc: Go in production with bonita-ui-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminParisel committed Jun 17, 2024
1 parent 9fa4dee commit 7ef309a
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/applications/applications-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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

===
83 changes: 83 additions & 0 deletions modules/applications/pages/production-packaging.adoc
Original file line number Diff line number Diff line change
@@ -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
----




0 comments on commit 7ef309a

Please sign in to comment.