TAMULib / mod-camunda

Apache License 2.0
0 stars 0 forks source link

Update build and run Dockerfile in mod-workflow to be more consistent with mod-camunda. #231

Closed kaladay closed 6 months ago

kaladay commented 1 year ago

This is pending approval for the build_and_run Dockerfile changes.

Steps

  1. As seen in the mod-camunda Dockerfile, change Dockerfile to operate not in the root directory. That is to say, add the following between line 9 and line 10 in the mod-workflow Dockerfile:

    RUN mkdir /mod-workflow
    WORKDIR /mod-workflow
  2. As seen in the mod-camunda Dockerfile, replace lines 10 through 17 in the mod-workflow Dockerfile with this:

    # copy required files
    COPY ./pom.xml ./pom.xml
    COPY ./components ./components
    COPY ./service ./service
  3. As seen in the mod-camunda Dockerfile, replace line 40 in the mod-workflow Dockerfile with this:

    COPY --from=maven /mod-workflow/service/target/workflow-service*.jar ./mod-workflow.jar
    • Note that unlike mod-camunda, this must have /service/ before target.

What this achieves is:

  1. Uses a sub-directory to compile mod-workflow without risking root level directories causes a problem.
  2. Groups the COPY files over to shorten the Dockefile (making it cleaner) and grouping together the directories and files that need to be copied.
  3. Makes the build and run Dockerfiles for both mod-camunda and mod-workflow as consistent as possible for easier maintenance.
kaladay commented 6 months ago

We are planning on getting rid of the build and run Dockerfile and so this should no longer be needed.